Closed nakigoe closed 2 years ago
Formatting a string using Razor means you are outputting HTML encoded content. To achieve a line-break in the rendered code, you will want to emit a
tag.
Blazor and Razor templates provide a layer of HTML-encoding on any string that should be rendered. To output a
tag, you need to use the Html.Raw
method to encode properly: https://docs.microsoft.com/aspnet/core/mvc/views/razor?view=aspnetcore-6.0#expression-encoding
I've tried that one already,
Blazor WebAssembly throws an error:
The name 'Html' does not exist in the current context
I cannot make a line break inside Blazor WebAssembly site navigation:
\n
,\r\n
,\u000A
$"{Environment.NewLine}"
have no visual impact:all suggestions are welcome