Skip to content
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

Fix for spurious whitespace in striptags output #418

Merged
merged 1 commit into from Feb 2, 2024

Conversation

dairiki
Copy link
Contributor

@dairiki dairiki commented Jan 25, 2024

This PR restores order of operations in Markup.striptags.

Prior to 2.1.4, the order of operations in striptags was:

  1. strip comments
  2. strip tags
  3. coalesce whitespace

In 2.1.4 the order changed to:

  1. coalesce whitespace
  2. strip comments
  3. strip tags

As a result extra spaces were introduced in the output in cases where whitespace was separated from more whitespace by a tag or comment.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • [n/a] Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • [n/a] Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@dairiki dairiki changed the title Fix.417 striptags spaces Fix for spurious whitespace in striptags output Jan 25, 2024
@davidism davidism changed the base branch from main to 2.1.x February 2, 2024 15:40
@davidism davidism closed this Feb 2, 2024
@davidism davidism reopened this Feb 2, 2024
@davidism davidism added this to the 2.1.5 milestone Feb 2, 2024
@davidism davidism merged commit 60a6512 into pallets:2.1.x Feb 2, 2024
12 checks passed
@dairiki
Copy link
Contributor Author

dairiki commented Feb 2, 2024

Thank you, @davidism!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markup.striptags: comments now get replaced with a space
3 participants