i wirte some code in LINQPad:
but with "InnerHtml" the result is "<br>", this isn't what i want.
why ?
i use ilspy to read the source code of InnerHtml :
i hope this will be fixed with the next release!
void Main()
{
var html = new HtmlDocument();
html.OptionAutoCloseOnEnd = true;
html.OptionWriteEmptyNodes = true;
html.OptionFixNestedTags = true;
html.LoadHtml("<br />");
html.DocumentNode.WriteContentTo().Dump();
html.DocumentNode.InnerHtml = "<br />";
html.DocumentNode.WriteContentTo().Dump();
}
output:<br />i changed the default options of the HtmlDocument, and i want the result is "<br />".
<br>
but with "InnerHtml" the result is "<br>", this isn't what i want.
why ?
i use ilspy to read the source code of InnerHtml :
public virtual string InnerHtml
{
get...
set
{
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(value);
this.RemoveAllChildren();
this.AppendChildren(doc.DocumentNode.ChildNodes);
}
}
it create a HtmlDocument object with default options, so the result is wrong!i hope this will be fixed with the next release!