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

Escaped double quotes are removed when formatting #90

Closed rogervanwile closed 3 months ago

rogervanwile commented 3 months ago

Describe the bug I'm using prettify to format my antlers files. When there is a escaped double quote in a attribute, the attribute will be wrong formatted and after a second prettifing, removed.

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

Versions and Other Plugins/Extensions

prettier: 3.3.2 prettier-plugin-antlers: 2.0.3

To Reproduce

Create a *.antlers.html template with the following code:

{{ partial:button attr="x-bind:disabled=\"submitting\"" }}

Run prettify once:

{{ partial:button attr="x-bind:disabled="submitting"" }}

After a second prettify run:

{{ partial:button attr="x-bind:disabled=" }}

The last attr is formatted wrong after the first run and removed in the second run.

Expected behavior

The attr should stay untouched. The syntax attr="x-bind:disabled=\"submitting\"" is correct.

If submitting a formatting bug, please include the template contents below as well as an attachment Add any problematic templates here.

Additional context Add any other context about the problem here.

JohnathonKoster commented 3 months ago

Thanks for the report!

JohnathonKoster commented 3 months ago

Resolved in the following versions: