I'm attempting to load basic HTML.
var html = "<div>something<p></p></div>"; var doc = new HtmlDocument(); doc.LoadHtml(html);
after this HTML has loaded
As a result, the ending P tag is lost, and my HTML is screwed up.
Can somebody assist me with this? I can't seem to locate a solution.
You're searching for the
Defines if empty nodes must be written as closed during output.
In your situation:
doc.OptionWriteEmptyNodes = true;