trivago / prettier-plugin-twig-melody

Code formatting plugin for Prettier which can handle Twig/Melody templates
Apache License 2.0
157 stars 35 forks source link

HTML Tag with string interpolation gets unexpected split on long lines #38

Open carusog opened 4 years ago

carusog commented 4 years ago

IF HTML tag contains a string interpolation AND last character of the line passes column 128

Prettier formats the line "in an unexpected" way.

E.G.

<!-- note: lines have 4 tabs (spaces) indentation before -->

{{ '&nbsp;' | raw }} - {{ '&nbsp;' | raw }} <time datetime="{{ formCheckOutDate.raw }}">{{ formCheckOutDate.formatted }}</time>

<!-- or -->
<span>Very long text content to make the line pass col 128</span> <span>{{ "Very long string to make the line pass col 128" }}</span>

Formatted code:

{{ '&nbsp;' | raw }} - {{ '&nbsp;' | raw }} <time datetime="{{ formCheckOutDate.raw }}">
                        {{ formCheckOutDate.formatted }}
                    </time>

<span>Very long text content to make the line pass col 128</span> <span>{{
                        'Very long string to make the line pass col 128'
                    }}</span>

Is that the expected output?