diff --git a/src/index.ts b/src/index.ts index 1ff2245..0b77555 100755 --- a/src/index.ts +++ b/src/index.ts @@ -725,7 +725,7 @@ export class Matcher { } // https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name -const kMarkupPattern = /)-->|<(\/?)([a-z][-.0-9_a-z]*)\s*([^>]*?)(\/?)>/ig; +const kMarkupPattern = /)-->|<(\/?)([a-z][-.:0-9_a-z]*)\s*([^>]*?)(\/?)>/ig; const kAttributePattern = /(^|\s)(id|class)\s*=\s*("([^"]+)"|'([^']+)'|(\S+))/ig; const kSelfClosingElements = { area: true, diff --git a/test/html.js b/test/html.js index d50e7b9..80c54bc 100644 --- a/test/html.js +++ b/test/html.js @@ -171,6 +171,11 @@ describe('HTML Parser', function () { }); + it('should be able to parse namespaces', function () { + const namespacedXML = 'content'; + parseHTML(namespacedXML).toString().should.eql(namespacedXML); + }); + it('should parse "

.." very fast', function () { for (var i = 0; i < 100; i++)