-
Notifications
You must be signed in to change notification settings - Fork 195
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 spaceless deprecation #399
Conversation
44a5767
to
cc14a60
Compare
Any chance this can be merged and a new release can be published? Twig 4 will be out soon, better to get ahead of this. Every one of my sites uses this wonderful library, so I see this message all the time.
|
cc14a60
to
3f35e94
Compare
I rebased this PR and updated it, now the CI passes without deprecations. The question raised by @stof is still open, though. This update would formally allow the library to be used with Twig 4, but the possible problem with the spaceless filter is not solved. |
maybe im missing it, but why not just remove the deprecated spaceless function from the template here? basically what #400 does. if tests are the issue, maybe apply spaceless output there to keep them passing/compatible. |
The "problem" is that this very library is more or less the prototype case of why the <ul>
<li>Aap</li>
<li>Noot</li>
<li>Mies</li>
</ul> Coupled with CSS rule In other words: just removing the |
😅 ok, i dont want to find out. Then i'd say port the twig spaceless filter as-is here. |
Here's a Codepen illustrating the problem: https://codepen.io/niels-keurentjes/pen/ByaKrrQ |
I am tempted to agree as in practice |
The issue with I wouldn't be surprised if that means that having a bold tag in part of a menu item label will be broken currently. Wouldn't it be a better option to make it exclusively remove whitespace between |
solving the deprecation in a BC manner is a 1st concern to me |
Exactly, it doesn't matter if right now it's breaking bold tags and everything, because at least now everybody's counting on it to be broken. We just want it to remain reliably broken, without the deprecation, and with forward compatibility with Twig 4, whilst we ponder whether a new major of this library should fix the underlying issue differently. The currently proposed fix can be shipped as patch release within Semver constraints. Let's do that and open a new central issue discussing the future. |
For the next major version of that library, I think we should be relying on whitespace control to remove Twig indentation spaces from the output (and this will have no runtime cost as the removal is even done at compile time). |
Yes I looked into a more fundamental solution today, but indeed that is the only way to go, and I don't see any way to do it in a backwards compatible way. |
maybe there's a css fix for future major upgrades, so we can stop rely on spacing in output |
@ro0NL if you rely on |
The CSS fix is essentially a matter of removing the spaceless filter, fixing the built-in templates to use whitespace control tags, slapping a v4 major version number on it, and adding a large bold section to the release notes stating "B/C break: all your template overrides are now broken if you are relying on inline block rendering, which is what older Bootstrap versions have done for years". We cannot fix for others how they use the library, so we have to treat it as a B/C break for every user. And if we were to do this, I'd recommend updating a ton of other stuff as well. |
@curry684 I fail to see how this is a CSS fix |
It isn't 😆 The implication is that, to fix it in CSS, is to force every library user to revise their local CSS. We cannot fix it here as we explained. |
Fix #395