-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Syntax Highlight] Unexpected syntax colouring inside HTML attribute quotes #93
Comments
replete
changed the title
[Syntax Highlight] Unexpected syntax colouring inside HTML attribute quotes using ternary operator
[Syntax Highlight] Unexpected syntax colouring inside HTML attribute quotes
Jul 10, 2024
Thanks for all the additional code samples!
*John Koster*
…On Wed, Jul 10, 2024 at 6:41 AM Phil Ricketts ***@***.***> wrote:
Another related example that causes a CSS parsing error in vscode:
Screenshot.2024-07-10.at.12.34.48.png (view on web)
<https://github.com/Stillat/vscode-antlers-language-server/assets/812139/45f39849-6654-4dce-a149-8e926c3b8995>
{{hero_carousel}}
{{if type == "hero_panel"}}
<li style="background-image: url('{{ glide :src="background_image" w="1920" format="webp" }}');" class="{{index == 0 ? 'active': ''}}" id="{{ name | slugify }}-panel">
<h1>{{ headline }}</h1>
<h2>{{ sub_headline }}</h2>
<a href="javascript:void(0);" style="background:#fff; padding:8px; color:var(--brand); text-shadow:none;">{{ link_text }}</a>
</li>
{{/if}}
{{/hero_carousel}}
When I remove this line, the problem disappears:
<li style="background-image: url('{{ glide :src="background_image"
w="1920" format="webp" }}');" class="{{index == 0 ? 'active': ''}}" id="{{
name | slugify }}-panel">
This works the same way with all extensions disabled.
Screenshot.2024-07-10.at.12.36.27.png (view on web)
<https://github.com/Stillat/vscode-antlers-language-server/assets/812139/575acb46-9cc3-4ab7-92a4-7c589a837044>
Thanks for putting this out there once again, I certainly appreciate the
challenges you have overcome with this tricky syntax.
—
Reply to this email directly, view it on GitHub
<#93 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABH5R6WXU74G4DJPNDX3T2DZLUMXTAVCNFSM6AAAAABKUWJ4YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRQGI4TMOBTGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Versions and Other Plugins/Extensions
vscode v1.91.0
To Reproduce
This HTML shows the problem:
Expected behavior
{ 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
(wont allow me to attach an html file for some reason)
Additional context
Thank you for making this extension 👍
The text was updated successfully, but these errors were encountered: