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

Deprecate the spaceless filter #4236

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented Aug 26, 2024

Closes #3576

Deprecate the spaceless filter for the following reasons:

If someone find it useful, re-creating it is trivial (return trim(preg_replace('/>\s+</', '><', $content ?? ''));),
but with so many caveats and not so many use cases, I think it does not belong to core.

Copy link
Member

@stof stof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter should be marked as deprecated in the filter definition, so that using the filter reports the deprecation at compile time (and so that the linter also reports it)

src/Extension/CoreExtension.php Outdated Show resolved Hide resolved
@fabpot fabpot force-pushed the spaceless-filter-deprecation branch from 0660869 to 6f4be01 Compare August 26, 2024 14:24
@fabpot fabpot force-pushed the spaceless-filter-deprecation branch from 6f4be01 to 9fd4c48 Compare August 26, 2024 14:25
@fabpot fabpot merged commit 98a8210 into twigphp:3.x Aug 26, 2024
48 of 49 checks passed
@fabpot fabpot deleted the spaceless-filter-deprecation branch August 26, 2024 15:00
tacman added a commit to tacman/KnpMenu that referenced this pull request Oct 27, 2024
better performance, etc.

twigphp/Twig#4236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Extension::spaceless: Algorithm removes spaces in the text and causes the meaning to be broken.
2 participants