Skip to content

Add templ lexer#1277

Open
bryce-d-greybeard wants to merge 1 commit into
alecthomas:masterfrom
bryce-d-greybeard:add-templ-lexer
Open

Add templ lexer#1277
bryce-d-greybeard wants to merge 1 commit into
alecthomas:masterfrom
bryce-d-greybeard:add-templ-lexer

Conversation

@bryce-d-greybeard
Copy link
Copy Markdown

Summary

Adds a lexer for templ, the Go HTML component/template language used by *.templ files.

The lexer handles templ declarations, Go-like control/code expressions, component calls such as @Button(...), and delegates ordinary HTML markup/text to the existing HTML lexer.

Tests

  • go test ./lexers
  • go test ./...

@alecthomas
Copy link
Copy Markdown
Owner

Is there a reason this is a Go lexer and not an XML lexer? If there isn't a good reason, please convert it.

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.

2 participants