Skip to content

Commit cf7b9af

Browse files
Add inline style for preserving whitespace in command output for improved HTML rendering
1 parent e4c7cd3 commit cf7b9af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/main.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ LogGroup 'Files analyzed' {
139139
# Transform the Command property with markdown code fences before building the table
140140
# --------------------------------------------------------------------------------
141141
$missedForDisplay = $codeCoverage.CommandsMissed | Sort-Object -Property File, Line | ForEach-Object {
142-
$command = '<pre><code class=''language-pwsh''>{0}</pre></code>' -f (Normalize-IndentationExceptFirst -Code $_.Command)
142+
$command = '<pre><code class=''language-pwsh'' style="white-space: pre;">{0}</pre></code>' -f (Normalize-IndentationExceptFirst -Code $_.Command)
143143
$command = $command.Replace([Environment]::NewLine, '<br>').Replace(' ', '&nbsp;')
144144
[PSCustomObject]@{
145145
File = $_.File
@@ -154,7 +154,7 @@ $missedForDisplay = $codeCoverage.CommandsMissed | Sort-Object -Property File, L
154154
}
155155

156156
$executedForDisplay = $codeCoverage.CommandsExecuted | Sort-Object -Property File, Line | ForEach-Object {
157-
$command = '<pre><code class=''language-pwsh''>{0}</pre></code>' -f (Normalize-IndentationExceptFirst -Code $_.Command)
157+
$command = '<pre><code class=''language-pwsh'' style="white-space: pre;">{0}</pre></code>' -f (Normalize-IndentationExceptFirst -Code $_.Command)
158158
$command = $command.Replace([Environment]::NewLine, '<br>').Replace(' ', '&nbsp;')
159159
[PSCustomObject]@{
160160
File = $_.File

0 commit comments

Comments
 (0)