Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitizing HTML throws an exception #469

Closed
Sicos1977 opened this issue Sep 25, 2023 · 1 comment
Closed

Sanitizing HTML throws an exception #469

Sicos1977 opened this issue Sep 25, 2023 · 1 comment

Comments

@Sicos1977
Copy link

Sicos1977 commented Sep 25, 2023

Hi,

I'm using the latest version that is on NuGet. When I try to sanitize the attached HTML it throws the following exception

at System.Text.StringBuilder.Append(String value, Int32 startIndex, Int32 count)
at Ganss.Xss.HtmlSanitizer.SanitizeStyleDeclaration(IElement element, ICssStyleDeclaration styles, String baseUrl)
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(IHtmlDocument document, IHtmlElement context, String baseUrl)
at ChromiumHtmlToPdfLib.Helpers.DocumentHelper.SanitizeHtml(ConvertUri inputUri, HtmlSanitizer sanitizer, ConvertUri& outputUri, List`1& safeUrls) in C:\XXXXX\ChromiumHtmlToPdf\ChromiumHtmlToPdfLib\Helpers\DocumentHelper.cs:line 269

@mganss mganss closed this as completed in 0b8b5d1 Sep 25, 2023
@mganss
Copy link
Owner

mganss commented Sep 25, 2023

Thanks for reporting this. Fixed in 8.0.718 and 8.1.719-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants