diff --git a/lexers/j/jsx.go b/lexers/j/jsx.go index 71642d6..7c098b9 100644 --- a/lexers/j/jsx.go +++ b/lexers/j/jsx.go @@ -69,8 +69,9 @@ var JSX = internal.Register(MustNewLexer( Include("root"), }, "jsx": { - {`(<)([\w]+)`, ByGroups(Punctuation, NameTag), Push("tag")}, - {`(<)(/)([\w]+)(>)`, ByGroups(Punctuation, Punctuation, NameTag, Punctuation), nil}, + {`(<)(/?)(>)`, ByGroups(Punctuation, Punctuation, Punctuation), nil}, + {`(<)([\w\.]+)`, ByGroups(Punctuation, NameTag), Push("tag")}, + {`(<)(/)([\w\.]+)(>)`, ByGroups(Punctuation, Punctuation, NameTag, Punctuation), nil}, }, "tag": { {`\s+`, Text, nil}, diff --git a/lexers/t/typescript.go b/lexers/t/typescript.go index 57d08bf..3b425ed 100644 --- a/lexers/t/typescript.go +++ b/lexers/t/typescript.go @@ -9,7 +9,7 @@ import ( var TypeScript = internal.Register(MustNewLexer( &Config{ Name: "TypeScript", - Aliases: []string{"ts", "typescript"}, + Aliases: []string{"ts", "tsx", "typescript"}, Filenames: []string{"*.ts", "*.tsx"}, MimeTypes: []string{"text/x-typescript"}, DotAll: true, @@ -32,6 +32,7 @@ var TypeScript = internal.Register(MustNewLexer( {`\n`, Text, Pop(1)}, }, "root": { + Include("jsx"), {`^(?=\s|/|