Closed mannfredz closed 11 months ago
Helps to provide some context:
Sanitizer
object is createdHi,
HtmlSanitizer Sanitizer = new HtmlSanitizer();
Sanitizer.Sanitize("<div style=\"border-width:1px;border-right-width:px;\"></div>");
This seems to be an issue within AngleSharp.Css. I have reported here: https://github.com/AngleSharp/AngleSharp.Css/issues/129
I've released 8.0.690-beta which depends on the fixed AngleSharp.Css version.
This HTML generates an exception ;
Sanitizer.Sanitize("<div style=\"border-width:1px;border-right-width:px;\"></div>");
System.NullReferenceException: Object reference not set to an instance of an object. at AngleSharp.Css.Values.CssPeriodicValue 1.get_CssText() at AngleSharp.Css.Dom.CssProperty.get_Value() at AngleSharp.Css.Dom.CssProperty.ToCss(TextWriter writer, IStyleFormatter formatter) at AngleSharp.Css.CssStyleFormatter.AngleSharp.IStyleFormatter.BlockDeclarations(IEnumerable 1 declarations) at AngleSharp.Css.Dom.CssStyleDeclaration.ToCssBlock(IStyleFormatter formatter) at AngleSharp.Css.Dom.CssStyleDeclaration.ToCss(TextWriter writer, IStyleFormatter formatter) at AngleSharp.FormatExtensions.ToCss(IStyleFormattable style, IStyleFormatter formatter) at Ganss.Xss.HtmlSanitizer.SanitizeStyle(IElement element, String baseUrl) at Ganss.Xss.HtmlSanitizer.DoSanitize(IHtmlDocument dom, IParentNode context, String baseUrl) at Ganss.Xss.HtmlSanitizer.SanitizeDom(String html, String baseUrl) at Ganss.Xss.HtmlSanitizer.Sanitize(String html, String baseUrl, IMarkupFormatter outputFormatter)