Skip to content

Commit 165ee2d

Browse files
committed
change kMarkupPattern to allow more custom element names per spec
1 parent b963e9b commit 165ee2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,8 @@ export class Matcher {
550550
}
551551
}
552552

553-
const kMarkupPattern = /<!--[^]*?(?=-->)-->|<(\/?)([a-z][a-z0-9]*-?[a-z0-9]*)\s*([^>]*?)(\/?)>/ig;
553+
// https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
554+
const kMarkupPattern = /<!--[^]*?(?=-->)-->|<(\/?)([a-z][-.0-9_a-z]*)\s*([^>]*?)(\/?)>/ig;
554555
const kAttributePattern = /(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/ig;
555556
const kSelfClosingElements = {
556557
meta: true,

0 commit comments

Comments
 (0)