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

Avoid useless whitespace control #284

Open
yguedidi opened this issue Mar 28, 2023 · 0 comments
Open

Avoid useless whitespace control #284

yguedidi opened this issue Mar 28, 2023 · 0 comments

Comments

@yguedidi
Copy link
Contributor

Would you accept in core a rule that forbid using whitespace control if the previous/next character is not a whitespace?

So forbid for example:

<div>{{- var -}}</div>

I think it's doable in a similar way to TrailingSpace by going through tokens.
I first thought about the RegEngineRule but it seems that it's focused on what happen inside Twig markup


As an extension of the idea, would be great to forbid it in block overrides too, like:

{% extends '...' %}

{%- block foo -%}
    ...
{%- endblock -%}

But here I have no idea how this is doable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant