Skip to content

Commit

Permalink
Restore formatting and links for errors, escape per line
Browse files Browse the repository at this point in the history
The previous fix disabled formatting entirely, this restores that but fixes the per-line styling errors (i.e. string containing `[T]`) before adding the links.
  • Loading branch information
kzu committed Jul 29, 2024
1 parent 1de8925 commit ecde834
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dotnet-trx/TrxCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,12 @@ void WriteError(string baseDir, List<Failed> failures, XElement result, StringBu
else
details.AppendLine("csharp");

foreach (var line in lines)
foreach (var line in lines.Select(x => x.EscapeMarkup()))
{
var match = ParseFile().Match(line);
if (!match.Success)
{
cli.AppendLine(line.EscapeMarkup());
cli.AppendLine(line);
details.AppendLineIndented(line, "> ");
continue;
}
Expand All @@ -445,7 +445,7 @@ void WriteError(string baseDir, List<Failed> failures, XElement result, StringBu
var error = new Panel(
$"""
[red]{message.EscapeMarkup()}[/]
[dim]{cli.ToString().EscapeMarkup()}[/]
[dim]{cli}[/]
""");
error.Padding = new Padding(5, 0, 0, 0);
error.Border = BoxBorder.None;
Expand Down

0 comments on commit ecde834

Please sign in to comment.