Improve parsing performance (fixes #161)

This commit is contained in:
Michael Ganss
2019-03-31 19:55:57 +02:00
parent 08993d4437
commit 0a9c2df4b9

View File

@@ -462,8 +462,7 @@ namespace Ganss.XSS
public IHtmlDocument SanitizeDom(string html, string baseUrl = "")
{
var parser = HtmlParserFactory();
var dom = parser.Parse("<html><body></body></html>");
dom.Body.InnerHtml = html;
var dom = parser.Parse("<html><body>" + html);
DoSanitize(dom, dom.Body, baseUrl);