twig.js icon indicating copy to clipboard operation
twig.js copied to clipboard

comma breaks parser

Open rafipiccolo opened this issue 1 year ago • 1 comments

when i add this comma before the last ")" twig breaks and renders nothing. white page. twig php does support this comma.

{% set motifs = motifs|merge(
    [
        {id: 'blabla'},
    ], {# <====  this comma is the issue #}
) %}

The comma gets added because of a linting rule that i apparently can't disable. https://github.com/VincentLanglet/Twig-CS-Fixer/issues/328

is there any chance of this to be supported ?

rafipiccolo avatar Nov 13 '24 08:11 rafipiccolo

There are some issues with multi-line arrays/maps that could also be causing this.

willrowe avatar Nov 13 '24 15:11 willrowe