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
Markup.striptags: comments now get replaced with a space #417
Comments
I've just noticed this change, too. I think the issue is that the old version of markupsafe/src/markupsafe/__init__.py Lines 165 to 168 in 496112e
The new version has reversed this order and coalesces whitespace before stripping comments and tags: markupsafe/src/markupsafe/__init__.py Lines 154 to 170 in b7cd652
(I think the old order of operations is more correct.) [eta: I've just created PR #418 that addresses this issue.] |
https://build.opensuse.org/request/show/1142212 by user dgarcia + anag+factory - Disable broken test with latest version of MarkupSafe (2.1.4) (gh#pallets/jinja#1930, gh#pallets/markupsafe#417)
https://build.opensuse.org/request/show/1142212 by user dgarcia + anag+factory - Disable broken test with latest version of MarkupSafe (2.1.4) (gh#pallets/jinja#1930, gh#pallets/markupsafe#417)
https://build.opensuse.org/request/show/1142212 by user dgarcia + anag+factory - Disable broken test with latest version of MarkupSafe (2.1.4) (gh#pallets/jinja#1930, gh#pallets/markupsafe#417)
In 2.1.4, if
Markup.striptags
is called, the comment gets replaced by a space. In versions before that it's completely removed from the output.Test case to reproduce:
With markupsafe 2.1.4 it fails, with 2.1.3 - it passes.
I'm running with Python 3.11
The issue was originally found by running the
test_striptags
jinja test case with markupsafe 2.1.4:https://github.com/pallets/jinja/blob/3fd91e4d11bdd131d8c12805177dbe74d85e7b82/tests/test_filters.py#L94
The text was updated successfully, but these errors were encountered: