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

Support for ??? "Empty Coalesce" operator #47

Open
kylecotter opened this issue May 2, 2020 · 1 comment
Open

Support for ??? "Empty Coalesce" operator #47

kylecotter opened this issue May 2, 2020 · 1 comment

Comments

@kylecotter
Copy link

Hi,

I'm using this with Craft CMS Twig templating and am curious how I'd go about circumventing a syntax error with the ??? operator.

I use this plugin, which it itself is based on a PR pending on the Twig repo, quite a bit.

When compiling with Prettier I get Error: ERROR: Unexpected token "?" of value "?" which occurs as an example, within a conditional such as {% if foo ??? bar %}

Obviously, it's right to throw an error as it isn't official Twig markup, but was wondering if there was a way to get past that.

Thanks a bunch for your work on this!

@mandrasch
Copy link

Hey, have you found a good solution? I only found out that I could use <!-- {% set id = element.myId ??? null %} --> around it to get past it, but these results in a lot of <!-- --> comments on page 🤔

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

2 participants