trivago / prettier-plugin-twig-melody

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

Prevent adding block name to endblock #22

Closed zebapy closed 4 years ago

zebapy commented 4 years ago

I see endblock is getting the opening block name appended after it like so

{% block layout_header %}
  {% include 'partials/school-header.twig' %}
{% endblock layout_header %}

I prefer NOT having the closing name

{% block layout_header %}
  {% include 'partials/school-header.twig' %}
{% endblock  %}

Is there a way to control this? I didn't see it as part of the twig coding standards.

twbartel commented 4 years ago

Thanks for your input. I agree, it does not always look good to have the name repeated there.

I have added an option twigOutputEndblockName and set its default to false. You should now not get the block name in the endblock tag any more. Please upgrade to v0.3.0.

zebapy commented 4 years ago

Whoa thanks for the fast implementation! 👍 👍 0.3.0 works great.

twbartel commented 4 years ago

You're welcome! Glad to hear it works.