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

Fix: Closing style tags on the same line cause syntax highlight issues #40

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

sirgallifrey
Copy link
Contributor

Is the same fix as #35 but for style tags now, as requested by @alehechka.

This PR fixes a syntax highlight issue when closing a style tag on the same line.
The issue is caused because of the .> which matches twice, first were we would expect, after <style> and then again after <style>...</style> because all >...</style is captured by .
My change seems to fix it without introducing regressions.

Examples of the issue (note the closing of the tags> )
Screenshot 2024-02-29 at 15 24 30
Screenshot 2024-02-29 at 15 24 06

This is how it can mess-up your file if you have more code, even after the closing of the template.
Screenshot 2024-02-29 at 15 23 44

This is how it looks after the fix
Screenshot 2024-02-29 at 15 23 24

@alehechka
Copy link
Contributor

@joerdav, here's the other PR to fix the inline-style tags I mentioned.

@joerdav joerdav merged commit 69ddaf0 into templ-go:main Mar 1, 2024
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.

3 participants