Skip to content

Commit 85c4153

Browse files
committed
fix: correctly parse <html:style></html:style>
1 parent 06ff08b commit 85c4153

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/angular-html-parser/test/index_spec.ts

+6
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,9 @@ describe("AST format", () => {
9696
]);
9797
});
9898
});
99+
100+
it("Edge cases", () => {
101+
expect(humanizeDom(parse("<html:style></html:style>"))).toEqual([
102+
[html.Element, ":html:style", 0],
103+
]);
104+
});

packages/compiler/src/ml_parser/lexer.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,11 @@ class _Tokenizer {
902902
if (!this._attemptCharCode(chars.$LT)) return false;
903903
if (!this._attemptCharCode(chars.$SLASH)) return false;
904904
this._attemptCharCodeUntilFn(isNotWhitespace);
905-
if (!this._attemptStrCaseInsensitive(tagName)) return false;
905+
if (!this._attemptStrCaseInsensitive(
906+
prefix && openToken.type !== TokenType.COMPONENT_OPEN_START ?
907+
`${prefix}:${tagName}`
908+
: tagName
909+
)) return false;
906910
this._attemptCharCodeUntilFn(isNotWhitespace);
907911
return this._attemptCharCode(chars.$GT);
908912
});

0 commit comments

Comments
 (0)