I'm trying to build HTML output with data that might contain HTML tags (simple ones, link or
).
If I add such a string to my HTML using CreateNode, some unwanted filtering happens. How can I fix this?
Example:
string myText = "<strong>Intro</strong><br />Some Explanation";
node.ParentNode.ReplaceChild(HtmlNode.CreateNode(myText, node);
In my resulting HTML, only the strong text is outputted, the rest is gone.
Why don't you try using InnerHtml ?
string myText = "<strong>Intro</strong><br />Some Explanation";
node.ParentNode.InnerHtml = myText;