Skip to content

Commit 6f0346e

Browse files
Refactor command output processing to improve HTML encoding and indentation handling in coverage report
1 parent 925ce64 commit 6f0346e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

scripts/main.ps1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,8 @@ LogGroup 'Set table for missed commands' {
163163

164164
foreach ($item in $codeCoverage.CommandsMissed | Sort-Object -Property File, Line) {
165165
$command = [System.Web.HttpUtility]::HtmlEncode($item.Command)
166-
$command = (Normalize-IndentationExceptFirst -Code $_.Command)
167-
$command = $command.Replace([Environment]::NewLine, '<br>').Replace(' ', '&nbsp;').Replace('{', '\{').Replace('}', '\}')
168-
$command = '<pre><code class="language-powershell">{0}</pre></code>' -f $command
166+
$command = Normalize-IndentationExceptFirst -Code $command
167+
# $command = $command.Replace([Environment]::NewLine, '<br>').Replace(' ', '&nbsp;').Replace('{', '\{').Replace('}', '\}')
169168
$missedForDisplay += @"
170169
<tr>
171170
<td>$($item.File)</td>
@@ -194,9 +193,8 @@ LogGroup 'Set table for executed commands' {
194193

195194
foreach ($item in $codeCoverage.CommandsExecuted | Sort-Object -Property File, Line) {
196195
$command = [System.Web.HttpUtility]::HtmlEncode($item.Command)
197-
$command = (Normalize-IndentationExceptFirst -Code $_.Command)
198-
$command = $command.Replace([Environment]::NewLine, '<br>').Replace(' ', '&nbsp;').Replace('{', '\{').Replace('}', '\}')
199-
$command = '<pre><code class="language-powershell">{0}</pre></code>' -f $command
196+
$command = Normalize-IndentationExceptFirst -Code $command
197+
# $command = $command.Replace([Environment]::NewLine, '<br>').Replace(' ', '&nbsp;').Replace('{', '\{').Replace('}', '\}')
200198
$missedForDisplay += @"
201199
<tr>
202200
<td>$($item.File)</td>

0 commit comments

Comments
 (0)