vscode-antlers-language-server icon indicating copy to clipboard operation
vscode-antlers-language-server copied to clipboard

[Syntax Highlight] Unexpected syntax colouring inside HTML attribute quotes

Open replete opened this issue 7 months ago • 3 comments

Describe the bug When using an antler tag contains a string (in example using a ternary operator) within an HTML attribute value, it displays error type syntax highlighting.

It appears the same with all extensions disabled, so I thought it would make sense to fix it within this plugin?

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

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

Versions and Other Plugins/Extensions vscode v1.91.0

To Reproduce This HTML shows the problem: Screenshot 2024-07-10 at 12 17 26

Expected behavior

  • within { is_current ? 'aria-current="page"' : '' }} I would expect 'aria-current="page"' and '' to not be highlighted differently to other values, it appears to me red like an error but is valid syntax. The antlers code works as expected in the application.

If submitting a formatting bug, please include the template contents below as well as an attachment

<nav aria-label="Main Navigation" role="navigation">
	<ul>
		{{ nav:main }}
		<li class="{{ is_current || is_parent ? 'active' : '' }}">
			<a href="{{ url }}" class="tx-lg font-bold mr-1" {{ is_current ? 'aria-current="page"' : '' }}>{{ title }}</a>
		{{ /nav:main}}
		</li>
	</ul>
</nav>

(wont allow me to attach an html file for some reason)

Additional context Thank you for making this extension 👍

replete avatar Jul 10 '24 11:07 replete