**Describe the bug** A `ParseError: Not well-formed XML starting with "<!"` is thrown when the doctype is lowercased and the mimetype is `text/html`. **To Reproduce** @xmldom/xmldom@0.9.6 fails: https://stackblitz.com/edit/js-xmldom-template-4yhw372e?file=index.js @xmldom/xmldom@0.9.0 fails: https://stackblitz.com/edit/js-xmldom-template-myp4xtfp?file=index.js @xmldom/xmldom@0.8.10 succeeds: https://stackblitz.com/edit/js-xmldom-template-wzm3upeq?file=index.js Thus this seems like a regression introduced in xmldom/xmldom@0.9.0 **Expected behavior** A lower cased doctype should be parsed correctly. According to the html spec the doctype is [a string that is an ASCII case-insensitive match for the string "<!DOCTYPE"](https://html.spec.whatwg.org/multipage/syntax.html#the-doctype:~:text=A%20string%20that%20is%20an%20ASCII%20case%2Dinsensitive%20match%20for%20the%20string%20%22%3C!DOCTYPE%22). The [W3C Markup validator](https://validator.w3.org/nu/#textarea) allows lowercased doctypes. Examples of websites with a lowercased doctype are [google.com](https://google.com) and [addons.opera.com](https://addons.opera.com). **Versions:** Affected @xmldom/xmldom versions: 0.9.0 - 0.9.6
Describe the bug
A
ParseError: Not well-formed XML starting with "<!"is thrown when the doctype is lowercased and the mimetype istext/html.To Reproduce
@xmldom/[email protected] fails: https://stackblitz.com/edit/js-xmldom-template-4yhw372e?file=index.js
@xmldom/[email protected] fails: https://stackblitz.com/edit/js-xmldom-template-myp4xtfp?file=index.js
@xmldom/[email protected] succeeds: https://stackblitz.com/edit/js-xmldom-template-wzm3upeq?file=index.js
Thus this seems like a regression introduced in xmldom/[email protected]
Expected behavior
A lower cased doctype should be parsed correctly.
According to the html spec the doctype is a string that is an ASCII case-insensitive match for the string "<!DOCTYPE".
The W3C Markup validator allows lowercased doctypes.
Examples of websites with a lowercased doctype are google.com and addons.opera.com.
Versions:
Affected @xmldom/xmldom versions: 0.9.0 - 0.9.6