Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: CreateNode does not support all tags?

$
0
0
I'm building up a complete HTML using C#, using ReplaceChild together with CreateNode. Most works pretty smooth, except for the following:
        switch (node.Attributes["attribute"].Value.ToLower())
        {
            case "table":
                strTest = "<table><tr><td>hello</td><td>world</td></tr></table>";
                break;
            case "bold":
                strTest = "Normal, <b>this is bold</b> and back to normal";
                break;
            case "italic":
                strTest = "Normal, <i>this is italic</i> and back to normal";
                break;
            default:
                break;
        }
        node.ParentNode.ReplaceChild(HtmlNode.CreateNode(strTest), node);
The table output is rendered correctly. If I add classes, styling can be done neatly in CSS.
However, when outputting the strings as can be seen in the bold and italic cases, output stops when the <b> or <i> tags are encountered. They simply do not exist in the resulting output.

What can be the problem? All tags are properly closed, and the output is part of a larger document and all other tags are handled correctly.

Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>