Skip to content
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

Add syntax highlighting support for HTML attribute conditional statements #33

Merged
merged 3 commits into from
Feb 18, 2024

Conversation

alehechka
Copy link
Contributor

Overview

Resolves a-h/templ#533

Added support for syntax highlighting on HTML attribute if/else expressions. I also went ahead and added support for else-if expressions, but based on the formatting that the LSP was making, it seems that this is not currently supported. But if you guys ever decide to add support for it you'll have the syntax highlighting ready to go!

I also put the pattern matching together in such a way that it supports multi-line if/else-if condition statements as well as nested logic (as shown in the after screenshot below).

Before

htm-attr-conditionals-broken

After

htm-attr-conditionals-fixed

@a-h a-h merged commit 783b1c5 into templ-go:main Feb 18, 2024
@alehechka alehechka deleted the issue_533 branch February 18, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode: HTML attribute conditionals do not have proper syntax highlighting
2 participants