mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-14 16:02:50 +08:00
Fix the "Escaping Interpolated Strings" documentation
* `MarkupLineInterpolated` instead of `MarkupInterpolated` * Use an actual interpolated string in sample code to make it valid
This commit is contained in:
parent
564c7b8f4e
commit
c32decfa55
@ -66,10 +66,11 @@ AnsiConsole.Markup("[red]{0}[/]", Markup.Escape("Hello [World]"));
|
||||
|
||||
## Escaping Interpolated Strings
|
||||
|
||||
When working with interpolated string, you can use the `MarkupInterpolated` and `MarkupInterpolatedLine` methods to automatically escape the values in the interpolated string holes.
|
||||
When working with interpolated string, you can use the `MarkupInterpolated` and `MarkupLineInterpolated` methods to automatically escape the values in the interpolated string holes.
|
||||
|
||||
```csharp
|
||||
AnsiConsole.MarkupInterpolated("[red]{0}[/]", "Hello [World]");
|
||||
string hello = "Hello [World]";
|
||||
AnsiConsole.MarkupInterpolated($"[red]{hello}[/]");
|
||||
```
|
||||
|
||||
## Setting background color
|
||||
|
Loading…
x
Reference in New Issue
Block a user