-
Notifications
You must be signed in to change notification settings - Fork 23
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
pre
tag keep format
#10
Comments
Currently there isn't. Whitespace normalization is the first thing that happens, before anything else, before even parsing the HTML fragment: html-sanitizer/html_sanitizer/sanitizer.py Line 194 in c914481
That being said, now that we have a real testsuite (feincms-cleanse didn't have good coverage) I wouldn't be against selectively normalizing whitespace as long as nothing else changes, resp. only whitespace changes without effect. This would probably mean normalizing |
Thanks a lot for the reply. It looks like it's not implemented yet but there's a way forward. 👍 |
html-sanitizer/html_sanitizer/sanitizer.py Line 194 in c914481
Commenting this line doesn't seem to break any tests at first glance, but I see this function removes more kind of whitespace than normalize_whitespace_in_text_or_tail .Would including these additional whitespace in that function be enough to not need normalize_overall_whitespace , as a first step?Thanks for the great package by the way! This is the last issue I've had with it. |
I think that the line does some things which are worthwhile such as normalizing various forms of whitespace. It could do this without collapsing whitespace though -- this decision could be left to I'm having a hard time constructing a non-artificial test case which fails without |
Oh, reading your comment again: I think it might work to just move the functionality inside |
I just wonder if there's an option to keep the format (e.g. white spaces, tabs, etc) in the
pre
tag.Thanks!
The text was updated successfully, but these errors were encountered: