Open mrtronje opened 4 years ago
After doing some research, I've found out that syntax errors are thrown before {# prettier-ignore #} is parsed.
We use this plugin to format Nunjucks files and had similar issue when tried to pass {% if %} block to an html attribute. The solution is using {% set %} wrapped in html comment (melody parser ignores html comments by default) like this:
<!-- {% set className = "some-class" if someExpression %} -->
<h1 class="{{ className }}">
Test
</h1>
Maybe want suit for your case though as you're passing {% block %} to the html tag.
If we use a block-statement inside a html-tag the prettier-ignore is not working.
Example to reproduce:
Output