Stillat / vscode-antlers-language-server

Provides rich language features for Statamic's Antlers templating language, including code completions, syntax highlighting, and more.
https://antlers.dev
MIT License
36 stars 3 forks source link

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

Closed petemolinero closed 3 months ago

petemolinero commented 3 months ago

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?

Versions and Other Plugins/Extensions

To Reproduce

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

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

JohnathonKoster commented 3 months ago

Thanks for the report!

JohnathonKoster commented 3 months ago

Resolved in the following versions:

petemolinero commented 3 months ago

Wow, so fast, thank you!!