Closed rzippo closed 3 months ago
This is happening because the Display
method will HTML encode the string.
When you know that the string is already valid HTML and you don't want to encode it, you can use DisplayAs("text/html")
:
It works, thanks!
I have C# code that creates a string with HTML code, like this one
If this HTML is put in its own HTML cell, it renders correctly like this![immagine](https://github.com/dotnet/interactive/assets/16462616/4bbfa6b2-0578-4a43-9645-55fd28a07f4b)
But if I try to render the C# string containing the HTML, I only get the text.![immagine](https://github.com/dotnet/interactive/assets/16462616/3b013e3c-0a37-4e82-9ff3-31eb50c4c832)
How do I get the string to be interpreted and rendered as HTML?