-
Notifications
You must be signed in to change notification settings - Fork 202
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
Html sanitize css property background-repeat #243
Comments
Here's the original HTML (please post such short snippets directly in the issue comments): <div style="font-size: 12pt; font-family: 'Segoe UI';">
<div fr-original-style="width: 400px; height: 400px; background-image: url('https://user-images.githubusercontent.com/42636057/96471112-437d9a80-122f-11eb-86c2-f30d9b0c8054.png'); background-repeat: no-repeat;"
style="width: 400px; height: 400px; background-image: url('https://user-images.githubusercontent.com/42636057/96471112-437d9a80-122f-11eb-86c2-f30d9b0c8054.png'); background-repeat: no-repeat;">
test</div>
</div> This is a bug that occurs because the parser unravels shorthand CSS properties such as sanitizer.AllowedCssProperties.Add("background-repeat-x");
sanitizer.AllowedCssProperties.Add("background-repeat-y"); Do you mean this by broken or do you think there is an additional issue? It seems that in the attached output file the newlines are missing but I can't repro that. |
While the above is true as a cause for the issue it seems there aren't officially CSS properties |
Chromium implements this partially (you can still see it in dev tools) and there were discussions to add it to the specification but it was decided against AFAICT: w3c/csswg-drafts#116 |
Attached file sample htmlBackgroundNoRepeat.html has css property background-repeat. When I sanitize html, property is gone and sanitize html is broken (cleanHtmlBackgroundNoRepeat.html).
attachedFiles.zip
The text was updated successfully, but these errors were encountered: