Skip to content

Commit

Permalink
refactor: change max size of element name to 128 (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
gungun974 authored Nov 13, 2023
1 parent b511005 commit f18e82f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions parser/v2/elementparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ var (
in.Seek(start)
return
}
if len(suffix)+1 > 32 {
if len(suffix)+1 > 128 {
ok = false
err = parse.Error("element names must be < 32 characters long", in.Position())
err = parse.Error("element names must be < 128 characters long", in.Position())
return
}
return prefix + suffix, true, nil
Expand Down
10 changes: 5 additions & 5 deletions parser/v2/elementparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -956,13 +956,13 @@ func TestElementParserErrors(t *testing.T) {
}),
},
{
name: "element: names cannot be greater than 32 characters",
input: `<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa></aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>`,
expected: parse.Error("element names must be < 32 characters long",
name: "element: names cannot be greater than 128 characters",
input: `<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa></aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>`,
expected: parse.Error("element names must be < 128 characters long",
parse.Position{
Index: 34,
Index: 130,
Line: 0,
Col: 34,
Col: 130,
}),
},
}
Expand Down

0 comments on commit f18e82f

Please sign in to comment.