diff --git a/.changeset/dull-dolphins-allow.md b/.changeset/dull-dolphins-allow.md
new file mode 100644
index 00000000..abc85e65
--- /dev/null
+++ b/.changeset/dull-dolphins-allow.md
@@ -0,0 +1,5 @@
+---
+"markuplint-angular-parser": patch
+---
+
+fix(angular-parser): parse tags with namespace correctly
diff --git a/.changeset/lucky-poets-fold.md b/.changeset/lucky-poets-fold.md
new file mode 100644
index 00000000..34253e11
--- /dev/null
+++ b/.changeset/lucky-poets-fold.md
@@ -0,0 +1,5 @@
+---
+"markuplint-angular-parser": patch
+---
+
+fix(angular-parser): support parsing void element like ``
diff --git a/packages/angular-parser/src/index.ts b/packages/angular-parser/src/index.ts
index d695780d..839bc77e 100644
--- a/packages/angular-parser/src/index.ts
+++ b/packages/angular-parser/src/index.ts
@@ -129,6 +129,9 @@ const visitor = {
const attributes: MLASTAttr[] = []
const childNodes: MLASTNode[] = []
+ // https://github.com/ikatyang/angular-html-parser/issues/22
+ nodeName = nodeName.startsWith(':') ? nodeName.slice(1) : nodeName
+
namespace =
attrs.find(attr => attr.name === 'xmlns')?.value ||
namespace ||
diff --git a/packages/angular-parser/test/__snapshots__/parser.spec.ts.snap b/packages/angular-parser/test/__snapshots__/parser.spec.ts.snap
index 7a49bb19..2b186a27 100644
--- a/packages/angular-parser/test/__snapshots__/parser.spec.ts.snap
+++ b/packages/angular-parser/test/__snapshots__/parser.spec.ts.snap
@@ -1874,6 +1874,157 @@ Object {
}
`;
+exports[`parser tag namespace 1`] = `
+Object {
+ "isFragment": true,
+ "nodeList": Array [
+ Object {
+ "attributes": Array [],
+ "endCol": 11,
+ "endLine": 1,
+ "endOffset": 10,
+ "endSpace": Object {
+ "endCol": 10,
+ "endLine": 1,
+ "endOffset": 9,
+ "raw": "",
+ "startCol": 10,
+ "startLine": 1,
+ "startOffset": 9,
+ },
+ "hasSpreadAttr": false,
+ "isCustomElement": false,
+ "isFragment": false,
+ "isGhost": false,
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "nodeName": "svg:defs",
+ "raw": "",
+ "selfClosingSolidus": Object {
+ "endCol": 10,
+ "endLine": 1,
+ "endOffset": 9,
+ "raw": "",
+ "startCol": 10,
+ "startLine": 1,
+ "startOffset": 9,
+ },
+ "startCol": 1,
+ "startLine": 1,
+ "startOffset": 0,
+ "tagCloseChar": ">",
+ "tagOpenChar": "<",
+ "type": "starttag",
+ },
+ Object {
+ "endCol": 7,
+ "endLine": 2,
+ "endOffset": 17,
+ "isFragment": false,
+ "isGhost": false,
+ "nodeName": "#text",
+ "raw": "
+ ",
+ "startCol": 11,
+ "startLine": 1,
+ "startOffset": 10,
+ "type": "text",
+ },
+ Object {
+ "attributes": Array [],
+ "endCol": 27,
+ "endLine": 2,
+ "endOffset": 37,
+ "endSpace": Object {
+ "endCol": 26,
+ "endLine": 2,
+ "endOffset": 36,
+ "raw": "",
+ "startCol": 26,
+ "startLine": 2,
+ "startOffset": 36,
+ },
+ "hasSpreadAttr": false,
+ "isCustomElement": false,
+ "isFragment": false,
+ "isGhost": false,
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "nodeName": "svg:linearGradient",
+ "raw": "",
+ "selfClosingSolidus": Object {
+ "endCol": 26,
+ "endLine": 2,
+ "endOffset": 36,
+ "raw": "",
+ "startCol": 26,
+ "startLine": 2,
+ "startOffset": 36,
+ },
+ "startCol": 7,
+ "startLine": 2,
+ "startOffset": 17,
+ "tagCloseChar": ">",
+ "tagOpenChar": "<",
+ "type": "starttag",
+ },
+ Object {
+ "attributes": Array [],
+ "endCol": 48,
+ "endLine": 2,
+ "endOffset": 58,
+ "isCustomElement": false,
+ "isFragment": false,
+ "isGhost": false,
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "nodeName": "svg:linearGradient",
+ "raw": "",
+ "startCol": 27,
+ "startLine": 2,
+ "startOffset": 37,
+ "tagCloseChar": ">",
+ "tagOpenChar": "",
+ "type": "endtag",
+ },
+ Object {
+ "endCol": 5,
+ "endLine": 3,
+ "endOffset": 63,
+ "isFragment": false,
+ "isGhost": false,
+ "nodeName": "#text",
+ "raw": "
+ ",
+ "startCol": 48,
+ "startLine": 2,
+ "startOffset": 58,
+ "type": "text",
+ },
+ Object {
+ "attributes": Array [],
+ "endCol": 16,
+ "endLine": 3,
+ "endOffset": 74,
+ "isCustomElement": false,
+ "isFragment": false,
+ "isGhost": false,
+ "namespace": "http://www.w3.org/1999/xhtml",
+ "nodeName": "svg:defs",
+ "raw": "",
+ "startCol": 5,
+ "startLine": 3,
+ "startOffset": 63,
+ "tagCloseChar": ">",
+ "tagOpenChar": "",
+ "type": "endtag",
+ },
+ ],
+}
+`;
+
+exports[`parser tag namespace 2`] = `
+"Snapshot Diff:
+Compared values have no visual difference."
+`;
+
exports[`parser void element 1`] = `
Object {
"isFragment": true,
diff --git a/packages/angular-parser/test/parser.spec.ts b/packages/angular-parser/test/parser.spec.ts
index 37f88f78..818825f3 100644
--- a/packages/angular-parser/test/parser.spec.ts
+++ b/packages/angular-parser/test/parser.spec.ts
@@ -70,4 +70,13 @@ describe('parser', () => {
expect(doc).toMatchSnapshot()
expect(snapshotDiff(cleanParse(parse(html)), doc)).toMatchSnapshot()
})
+
+ test('tag namespace', () => {
+ const html = /* HTML */ `
+
+ `
+ const doc = cleanParse(html)
+ expect(doc).toMatchSnapshot()
+ expect(snapshotDiff(cleanParse(parse(html)), doc)).toMatchSnapshot()
+ })
})