Skip to content

Fix for spurious whitespace in striptags output#418

Merged
davidism merged 1 commit intopallets:2.1.xfrom
dairiki:fix.417-striptags-spaces
Feb 2, 2024
Merged

Fix for spurious whitespace in striptags output#418
davidism merged 1 commit intopallets:2.1.xfrom
dairiki:fix.417-striptags-spaces

Conversation

@dairiki
Copy link
Copy Markdown
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 force-pushed the fix.417-striptags-spaces branch from 596a0b8 to 0b6bee0 Compare February 2, 2024 15:40
@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
@dairiki
Copy link
Copy Markdown
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