Skip to content

Commit 3032e07

Browse files
committed
Escape error messages in ubik when printing with orange color
1 parent 843e08c commit 3032e07

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/Ubik/Program.fs

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ let analyzeFiles (fsharpFiles: FilePath[]) =
128128
AnsiConsole.MarkupLine(" [blue]{0} |[/]", before.PadLeft(maxLength, ' '))
129129
AnsiConsole.MarkupLine(" [blue]{0} |[/] {1}", current.PadLeft(maxLength, ' '), original)
130130
AnsiConsole.MarkupLine(" [blue]{0} |[/] {1}", after.PadLeft(maxLength, ' '), marker)
131-
AnsiConsole.MarkupLine("[orange1]{0}[/]", message.Message)
131+
AnsiConsole.MarkupLine("[orange1]{0}[/]", message.Message.EscapeMarkup())
132132
errorCount.Add(1)
133-
else
133+
else
134134
let lines = [range.StartLine-1 .. range.EndLine+1]
135135
let maxLength =
136136
lines
@@ -142,7 +142,7 @@ let analyzeFiles (fsharpFiles: FilePath[]) =
142142
then AnsiConsole.MarkupLine(" [blue]{0} |[/] ", line.ToString().PadLeft(maxLength, ' '))
143143
else AnsiConsole.MarkupLine(" [blue]{0} |[/] {1}", line.ToString().PadLeft(maxLength, ' '), source.GetLineString(line - 1).EscapeMarkup())
144144

145-
AnsiConsole.MarkupLine("[orange1]{0}[/]", message.Message)
145+
AnsiConsole.MarkupLine("[orange1]{0}[/]", message.Message.EscapeMarkup())
146146
errorCount.Add(1)
147147
let exitCode = errorCount.Sum()
148148
Console.WriteLine()

0 commit comments

Comments
 (0)