Open
Description
Expected Behavior
End-of-lines with CRLF or CR should be recognized and treated properly.
Actual Behavior
When parsing HTML string containing CRLF end-of-lines, invalid tags with name _html_dom_parser_carriage_return_placeholder_<random-number>_
are created, causing the HTML to not display properly, and also causing NextJS to fail hydration.
Steps to Reproduce
- Load the following SVG using Node and pass the content to
parse()
- Bizarre and invalid HTML tag gets created, and the SVG does not display:
- Save the file with LF endings instead, and retry step 2. SVg gets parsed correctly.
Reproducible Demo
Will provide if needed. But the problem here is probably faster to spot in your codebase than for me to write a demo.
Environment
- Version: 5.2.2
- Platform: NextJS/NodeJS
- Browser: Edge
- OS: Windows x64