Closed drjova closed 2 years ago
h1
is a block level tag. Bleach 5.0.0 fixed sanitizing so that when it removes block-level tags, it adds a \n
because that's what HTML parsers would do in those circumstances. The problem was covered in issue #369.
@willkg Thank you for the explanation. It would be nice to have an option to disable this since not all use-cases need to make the text more readable. Would it be considered if I made a PR?
What's your use case that this is problematic?
In our case we would like to clean specific tags, including block-level
tags, without formatting the content.
That doesn't really answer my question--it mostly restates the bug. What's the use case here? Why is adding a \n
problematic?
Describe the bug
A clear and concise description of what the bug is. [e.g. "
bleach.clean
does not escape script tag contents"]python and bleach versions (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Thank you 🙏