I have some HTML that is stored in a string. How can I render it in a Blazor/Razor view without automatic HTML encoding?
Not right now, but will have it probably in the next version: Follow this.
Workaround (from that issue):
cshtml
@functions{
[Parameter] string Content { get; set; }
private ElementRef Span;
protected override void OnAfterRender()
{
Microsoft.AspNetCore.Blazor.Browser.Interop.RegisteredFunction.Invoke("RawHtml", Span, Content);
}
}
index.html