Closed fayyazul-centaurlabs closed 2 years ago
Bleach clean works on fragments--not entire HTML documents--so this is currently outside the scope of the project.
You could probably get by by removing the HTML and BODY tags, then running the result through Bleach clean.
Another option could be to write your own Cleaner class that overrides clean
:
You'd need to at least call parse
instead of parseFragment
. I'm not sure what else would need changing.
Hope that helps!
That helps a lot. Thanks @willkg!
Describe the bug
bleach.clean removing html and body tags even when those tags are allowed.
python and bleach versions (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected output
Actual output