mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-14 16:02:50 +08:00
Make method reference to Markup.Escape more obvious
best-practices refers and links to the `Markup.Escape` method but labeled it `EscapeMarkup`. I got quite confused trying to find EscapeMarkup. Using the typical *class dot method* pattern seems preferable. It also matches what you write in code.
This commit is contained in:
parent
ca441dbe7a
commit
b61fff042b
@ -60,7 +60,7 @@ Spectre.Console will tell your terminal to use the color that is configured in t
|
||||
If you are using an 8 or 24-bit color for the foreground text, it is recommended that you also set an appropriate
|
||||
background color to match.
|
||||
|
||||
**Do** escape data when outputting any user input or any external data via Markup using the [`EscapeMarkup`](xref:M:Spectre.Console.Markup.Escape(System.String)) method on the data. Any user input containing `[` or `]` will likely cause a runtime error while rendering otherwise.
|
||||
**Do** escape data when outputting any user input or any external data via Markup using the [`Markup.Escape`](xref:M:Spectre.Console.Markup.Escape(System.String)) method on the data. Any user input containing `[` or `]` will likely cause a runtime error while rendering otherwise.
|
||||
|
||||
**Consider** replacing `Markup` and `MarkupLine` with [`MarkupInterpolated`](xref:M:Spectre.Console.AnsiConsole.MarkupInterpolated(System.FormattableString)) and [`MarkupLineInterpolated`](xref:M:Spectre.Console.AnsiConsole.MarkupLineInterpolated(System.FormattableString)). Both these methods will automatically escape all data in the interpolated string holes. When working with widgets such as the Table and Tree, consider using [`Markup.FromInterpolated`](xref:M:Spectre.Console.Markup.FromInterpolated(System.FormattableString,Spectre.Console.Style)) to generate an `IRenderable` from an interpolated string.
|
||||
|
||||
@ -119,4 +119,4 @@ For cmd.exe, the following steps are required to enable Unicode and Emoji suppor
|
||||
5. Reboot.
|
||||
|
||||
You will also need to ensure that your Console application is configured to use a font that supports Unicode and Emoji,
|
||||
such as Cascadia Code.
|
||||
such as Cascadia Code.
|
||||
|
Loading…
x
Reference in New Issue
Block a user