Stillat/vscode-antlers-language-server

Garbled contents of {{# format-ignore-* #}} when inside a loop

Closed this issue · 3 comments

Describe the bug
When I try to ignore formatting on a section inside a loop, it results in garbled output:

{{ myvar }}
    {{# format-ignore-start #}}
    {{ partial:mytemplate }}
    {{# format-ignore-end #}}
{{ /myvar }}

When I run the antlers formatter, it creates this:

{{ myvars }}
    <aecm3hp7xneacrwla />
{{ /myvars }}

Impacted Products
Which Antlers Toolbox products does this bug apply to?

  • Antlers Toolbox for VS Code
  • Formatter CLI (untested)
  • Antlers Prettier Plugin
  • Antlers Syntax Highlighting (external systems - not VS Code)

Versions and Other Plugins/Extensions

  • VS Code 1.89.1
  • Antlers Toolbox v2.6.15
  • prettier-plugin-antlers v2.0.2

To Reproduce

  1. Enter the following into an antlers.html file
{{ myvar }}
    {{# format-ignore-start #}}
    {{ partial:mytemplate }}
    {{# format-ignore-end #}}
{{ /myvar }}
  1. Run prettier with the antlers plugin
  2. It garbles the output

Expected behavior
It should simply ignore formatting within the ignore tags.

Thanks for the report!

Resolved in the following versions:

  • Antlers Toolbox for VS Code: 2.6.16
  • antlers-language-server: 1.3.12
  • prettier-plugin-antlers: 2.0.3
  • antlers-formatter: 1.2.12

Wow, so fast, thank you!!