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

Highlight doesn't work for 'is not empty' and 'is not defined' #78

Open
dmitrach opened this issue May 26, 2021 · 0 comments
Open

Highlight doesn't work for 'is not empty' and 'is not defined' #78

dmitrach opened this issue May 26, 2021 · 0 comments

Comments

@dmitrach
Copy link

Twig support 'is not' and 'empty':
https://twig.symfony.com/doc/2.x/templates.html#test-operator
https://twig.symfony.com/doc/2.x/tests/empty.html

But for the combination the highlight doesn't work. Also it doesn't work for 'defined'.

Empty: 
{{ post.content is empty ? 'action-true' : 'action-false' }} It works.
{{ post.content is not empty ? 'action-true' : 'action-false' }} It doesn't work. It equals {{ not post.content ? 'action' }}
{{ not post.content is empty ? 'action-true' : 'action-false' }} It works.

Defined:
{{ test is not defined ? 'action-when-undefined' }} It doesn't work. It doesn't equal {{ not test ? 'action' }} and {{ test is empty ? 'action' }}
{{ not test is defined ? 'action-when-undefined' }} It works.

{# Defines the variable #}
{% set test = false %}

They are correct expressions.

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