diff --git a/.version b/.version index 8840c547b..91dbe0903 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.2.681 \ No newline at end of file +0.2.682 \ No newline at end of file diff --git a/parser/v2/elementparser.go b/parser/v2/elementparser.go index 18b12b6f9..f64990087 100644 --- a/parser/v2/elementparser.go +++ b/parser/v2/elementparser.go @@ -361,7 +361,7 @@ func (attributesParser) Parse(in *parse.Input) (attributes []Attribute, ok bool, // Element name. var ( elementNameFirst = "abcdefghijklmnopqrstuvwxyz" - elementNameSubsequent = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-" + elementNameSubsequent = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-:" elementNameParser = parse.Func(func(in *parse.Input) (name string, ok bool, err error) { start := in.Index() var prefix, suffix string diff --git a/parser/v2/elementparser_test.go b/parser/v2/elementparser_test.go index 6bb695aa3..1399ae9a3 100644 --- a/parser/v2/elementparser_test.go +++ b/parser/v2/elementparser_test.go @@ -41,6 +41,31 @@ func TestAttributeParser(t *testing.T) { }, }, }, + { + name: "element: colon in name", + input: ``, + parser: StripType(elementOpenTagParser), + expected: elementOpenTag{ + Name: "maps:map", + NameRange: Range{ + From: Position{Index: 1, Line: 0, Col: 1}, + To: Position{Index: 9, Line: 0, Col: 9}, + }, + }, + }, + { + name: "element: colon in name, closing", + input: `Content`, + parser: StripType(element), + expected: Element{ + Name: "maps:map", + NameRange: Range{ + From: Position{Index: 1, Line: 0, Col: 1}, + To: Position{Index: 9, Line: 0, Col: 9}, + }, + Children: []Node{Text{Value: "Content"}}, + }, + }, { name: "element: open with hyperscript attribute", input: `
`,