Open codeconscious opened 3 months ago
In this case the AnsiConsole.Write()
is calling an internal function that is using format strings. Trying "{{Pt.1}} (TEST ~ 855D)"
will return {Pt.1} (TEST ~ 855D)
In this case the
AnsiConsole.Write()
is calling an internal function that is using format strings. Trying"{{Pt.1}} (TEST ~ 855D)"
will return{Pt.1} (TEST ~ 855D)
Thanks for the tip! Indeed, I confirmed that this workaround for Write
works:
var text = @"{{Pt.1}} (TEST ~ 855D)";
AnsiConsole.WriteLine(text);
AnsiConsole.WriteLine(text.EscapeMarkup());
AnsiConsole.Write(text + Environment.NewLine);
AnsiConsole.Write(text.EscapeMarkup() + Environment.NewLine);
Output:
{{Pt.1}} (TEST ~ 855D)
{{Pt.1}} (TEST ~ 855D)
{Pt.1} (TEST ~ 855D)
{Pt.1} (TEST ~ 855D)
Information
Describe the bug A string containing the text
{Pt.1} (TEST ~ 855D)
causesAnsiConsole.Write()
to throw the following exception:Interestingly, this does not occur with
AnsiConsole.WriteLine()
. Also, usingEscapeMarkup()
on the string does not resolve the issue.Similarly-formatted strings behave identically. I believe it's likely some of the text is unexpectedly being treated as markup.
I hope this is information is sufficient. Please let me know if you need anything more or if perhaps I'm overlooking anything (including a potential workaround). Thank you much.
To Reproduce
Expected behavior All lines written successfully to the terminal with markup-like text not treated as markup.
Screenshots None.
Additional context None.
Please upvote :+1: this issue if you are interested in it.