dom-parser icon indicating copy to clipboard operation
dom-parser copied to clipboard

Fast dom parser based on regexps

Results 22 dom-parser issues
Sort by recently updated
recently updated
newest added

The bug is from this line 'currentObject.childNodes.push(new Node({', the position of it is '\node_modules\dom-parser\lib\Dom.js:88'. Error produced: 'Cannot read property 'childNodes' of null' Not 100% sure if this is a bug...

Change in regex: allows _more than_ 1 group starting with colon OR hyphen OR underline added test

In general, when a tag is a prefix for another, looking for that tag will also return the other tag as well. This update fixes #10.

The tag regex is incorrectly parsing use tags in svg ``` const tagRegExp = /()|([^

var DomParser = require('dom-parser'); var parser = new DomParser(); fs.readFile("D:\\pageLoadPerformance\\pageLoad\\BI.html", 'utf8', function (err, html) { if (!err) { var document:Document = parser.parseFromString(html); console.log(document) console.log(document.getElementsByTagName("a")[0].innerText) } }) Output : Node {...

Object returned when calling to `parseFromString()` doesn't includes [`documentElement` field](https://developer.mozilla.org/en-US/docs/Web/API/Document/documentElement).

#4 `classList` in node propperty.

**TypeError: Cannot read property 'childNodes' of null** **** when i remove this from start it works but get above error with it.

* Previously node.parentNode will always return null, it has been fixed. * Doctype can now be parsed correctly.

On the browser we can do `new DOMParser().parseFromString('').querySelectorAll`, it would be nice to have it too