simon-dt/gulp-twig

Linebreaks inside "with" params will cause an exception

Closed this issue · 1 comments

I noticed line breaks inside the parameters object will break the embed function.

Will work:

{% embed 'skeletons/sidebarBox.twig' with { 'class': 'relatedContents' } %}
…
{% endembed %}

Won't work:

{% embed 'skeletons/sidebarBox.twig' with {
    'class': 'relatedContents'
} %}
…
{% endembed %}

TwigException: Unable to parse 'embed 'skeletons/sidebarBox.twig' with {
'class': 'relatedContents'
}'

This behavior is different to include and require where line breaks cause no trouble.

This is just the gulp plugin. The bug is in twig.js, it seems to be fixed already.
twigjs/twig.js#386

I suggest to close this issue.