jindw/xmldom — pull request #43 by kethinov (2013-01-24 09:39:35+00:00)
Title: 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 = '

content

',
doc = new DOMParser().parseFromString(string, 'text/html'),
s = XMLSerializer,
str = s.serializeToString(doc);
console.log(str);

I'm not sure if my commit is the best way to fix the bug or not, but it seems to work. :)