Closed j-jalving closed 11 months ago
The opening and closing "name" part of the conditional tag need to match, so something like would work:
<{{ url ? 'a' : 'span' }} other things here>
{{ title }}
</{{ url ? 'a' : 'span' }}>
These sections of code can be ignored by the formatter using the following special Antlers comments:
{{# format-ignore-start #}}
Code to ignore
{{# format-ignore-end #}}
Having mixed open/closed tags like that is not supported by the Antlers formatter due to how its been implemented (Prettier itself does not like unexpected closing tags/etc.)
I understand, thanks for the suggestions to solve this
Describe the bug Antlers Prettier Plugin is having trouble with conditional tags.
Impacted Products Which Antlers Toolbox products does this bug apply to?
Versions and Other Plugins/Extensions Please include the product version you are reporting a bug for. If you are reporting a bug for products such as Antlers Toolbox for VS Code or the Antlers Prettier Plugin, please include a list of other configured extensions or plugins if you believe they are contributing to the problematic behavior.
To Reproduce Add this to a antlers file, or any other syntax using conditional tags.
Expected behavior I would expect the lines to be formatted, but an error is thrown: