Please sign in to comment.
Fixing bug: DOCTYPE was being stripped by parseFromString
This commit resolves a bug which caused the DOCTYPE to be stripped by DOMParser().parseFromString when parsing HTML documents. The following test case was used (run in Node.js): var xmldom = require('xmldom'), DOMParser = xmldom.DOMParser, XMLSerializer = new xmldom.XMLSerializer(), string = '<!doctype html><html><head></head><body>content</body></html>', doc = new DOMParser().parseFromString(string, 'text/html'), s = XMLSerializer, str = s.serializeToString(doc); console.log(str);
- Loading branch information...