Skip to content

Commit 4249e5d

Browse files
committed
Fix an issue where <h2> was not allowed as an HTML element name
1 parent 4b8311f commit 4249e5d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tsdoc/src/parser/NodeParser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,8 +1813,9 @@ export class NodeParser {
18131813
let done: boolean = false;
18141814
while (!done) {
18151815
switch (tokenReader.peekTokenKind()) {
1816-
case TokenKind.AsciiWord:
18171816
case TokenKind.Hyphen:
1817+
case TokenKind.Period:
1818+
case TokenKind.AsciiWord:
18181819
tokenReader.readToken();
18191820
break;
18201821
default:

tsdoc/src/parser/StringChecks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class StringChecks {
99

1010
// https://www.w3.org/TR/html5/syntax.html#tag-name
1111
// https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
12-
private static readonly _htmlNameRegExp: RegExp = /^[a-z]+(\-[a-z]+)*$/i;
12+
private static readonly _htmlNameRegExp: RegExp = /^[a-z][\-.0-9_a-z]*$/i;
1313

1414
// Note: In addition to letters, numbers, underscores, and dollar signs, modern ECMAScript
1515
// also allows Unicode categories such as letters, combining marks, digits, and connector punctuation.

0 commit comments

Comments
 (0)