mirror of
https://github.com/alecthomas/chroma.git
synced 2025-09-16 09:16:32 +02:00
modify jsx lexer to handle tags with periods
This commit is contained in:
committed by
Alec Thomas
parent
38460d1881
commit
26f03cb449
@@ -8,8 +8,8 @@ import (
|
||||
var JSXRules = func() Rules {
|
||||
rules := JavascriptRules.Clone()
|
||||
rules["jsx"] = []Rule{
|
||||
{`(<)([\w_\-]+)`, ByGroups(Punctuation, NameTag), Push("tag")},
|
||||
{`(<)(/)(\s*)([\w_\-]+)(\s*)(>)`, ByGroups(Punctuation, Punctuation, Text, NameTag, Text, Punctuation), nil},
|
||||
{`(<)([\w\._\-]+)`, ByGroups(Punctuation, NameTag), Push("tag")},
|
||||
{`(<)(/)(\s*)([\w\._\-]+)(\s*)(>)`, ByGroups(Punctuation, Punctuation, Text, NameTag, Text, Punctuation), nil},
|
||||
}
|
||||
rules["tag"] = []Rule{
|
||||
{`\s+`, Text, nil},
|
||||
|
Reference in New Issue
Block a user