spectre.console icon indicating copy to clipboard operation
spectre.console copied to clipboard

EscapeMarkup doesn't work when using [link=...]

Open richardwerkman opened this issue 2 years ago • 0 comments

Information

  • OS: [Windows]
  • Version: [0.44.0]
  • Terminal: [Windows Terminal]

Describe the bug Escape doesn't work in some cases. It seems in combination with [link] it throws an exception Encountered unescaped ']' token at position 56

To Reproduce

            var path = "C:\\Dev\\ExampleProjects\\TestApp\\TestApp[-].UnitTests\\StrykerOutput\\2022-07-22.15-27-40\\reports\\mutation-report.html";
            // the next line prints our path
            AnsiConsole.Console.MarkupLineInterpolated($"[Green]{path}[/]");
            // the next line throws an exception
            AnsiConsole.Console.MarkupLineInterpolated($"[Green][link={path}]{path}[/][/]");

Expected behavior No exception.

Additional context This is an actual use case in Stryker.

richardwerkman avatar Jul 22 '22 13:07 richardwerkman