simon-dt / gulp-twig

Twig plugin for gulp.js, The streaming build system. Looking for maintainer or collaborators. See wiki
https://github.com/zimmen/gulp-twig/wiki/Looking-for-maintainer-or-collaborator(s)
MIT License
62 stars 33 forks source link

Linebreaks inside "with" params will cause an exception #28

Closed bluemoehre closed 7 years ago

bluemoehre commented 8 years ago

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.

ghost commented 7 years ago

This is just the gulp plugin. The bug is in twig.js, it seems to be fixed already. https://github.com/twigjs/twig.js/issues/386

I suggest to close this issue.