From 05bec0a587f123391b9317f11af410c5c96db4da Mon Sep 17 00:00:00 2001 From: AdmiringWorm Date: Fri, 3 Jun 2022 12:52:18 +0200 Subject: [PATCH] Added special handling for file details section --- scripts/public/Test-NewIssue.ps1 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/public/Test-NewIssue.ps1 b/scripts/public/Test-NewIssue.ps1 index a4544a5..ce2b6b0 100644 --- a/scripts/public/Test-NewIssue.ps1 +++ b/scripts/public/Test-NewIssue.ps1 @@ -133,18 +133,35 @@ function Test-NewIssue { $warnings = $validationData.messages | Where-Object type -EQ ([MessageType]::Warning) if ($warnings) { $commentBody += "`n`n" + [ValidationMessages]::noticesHeader + $detailsComment = "" $warnings | ForEach-Object { - $commentBody += "`n- $($_.message)" + # When using the
section, special handling is needed + if ($_.message -match "\") { + $detailsComment = $_.message + } + else { + $commentBody += "`n- $($_.message)" + } } + $commentBody += "`n`n$detailsComment" } } $infos = $validationData.messages | Where-Object type -EQ ([MessageType]::Info) if ($infos) { $commentBody += "`n`n" + [ValidationMessages]::maintainersHeader + $detailsComment = "" $infos | ForEach-Object { - $commentBody += "`n- $($_.message)" + # When using the
section, special handling is needed + if ($_.message -match "\") { + $detailsComment = $_.message + } + else { + $commentBody += "`n- $($_.message)" + } } + + $commentBody += "`n`n$detailsComment" } $commentBody += [ValidationMessages]::commentBodyFooter