@@ -482,7 +482,7 @@ public string SanitizeDocument(string html, string baseUrl = "", IMarkupFormatte
482
482
483
483
using ( var dom = parser . Parse ( html ) )
484
484
{
485
- DoSanitize ( dom , dom . DocumentElement , baseUrl ) ;
485
+ DoSanitize ( dom , dom , baseUrl ) ;
486
486
487
487
var output = dom . ToHtml ( outputFormatter ?? OutputFormatter ) ;
488
488
@@ -503,7 +503,7 @@ public string SanitizeDocument(Stream html, string baseUrl = "", IMarkupFormatte
503
503
504
504
using ( var dom = parser . Parse ( html ) )
505
505
{
506
- DoSanitize ( dom , dom . DocumentElement , baseUrl ) ;
506
+ DoSanitize ( dom , dom , baseUrl ) ;
507
507
508
508
var output = dom . ToHtml ( outputFormatter ?? OutputFormatter ) ;
509
509
@@ -542,7 +542,7 @@ private void RemoveComments(IElement context)
542
542
}
543
543
}
544
544
545
- private void DoSanitize ( IHtmlDocument dom , IElement context , string baseUrl = "" )
545
+ private void DoSanitize ( IHtmlDocument dom , IParentNode context , string baseUrl = "" )
546
546
{
547
547
// remove non-whitelisted tags
548
548
foreach ( var tag in context . QuerySelectorAll ( "*" ) . Where ( t => ! IsAllowedTag ( t ) ) . ToList ( ) )
@@ -607,9 +607,9 @@ private void DoSanitize(IHtmlDocument dom, IElement context, string baseUrl = ""
607
607
}
608
608
}
609
609
610
- RemoveComments ( context ) ;
610
+ RemoveComments ( context as IElement ) ;
611
611
612
- DoPostProcess ( dom , context ) ;
612
+ DoPostProcess ( dom , context as IElement ) ;
613
613
}
614
614
615
615
private void SanitizeStyleSheets ( IHtmlDocument dom , string baseUrl )
0 commit comments