New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XMLParser fails for script tag with JS-Code that looks like a start tag #504
Comments
the reason of this bug: only one the regex can't correct match incorrect match result: html
head
title
title
head
body
script
vars.length
body
html happy-dom/packages/happy-dom/src/xml-parser/XMLParser.ts Lines 85 to 93 in 8ece290
|
Thanks for reporting @baranor! 🙂 |
…-with-tags #504@patch: Fixes XmlParser error parse with tags.
Thanks to @Mas0nShi we now have a fix in place 🙂 You can read more about the release here: |
I ran into a problem where adding the following HTML code (simplified):
via
document.write(...)
(with script execution) ordocument.documentElement.outerHTML = ...
(without script execution).After some debugging I found the XMLParser is at fault here, as it tries to parse the
<vars
condition in the for-loop as a new tag.The problem did have a different impact depending on the actual HTML structure:
textContent
of the script tag was most of the HTML document after that pointIf I understand the current parser implementation correctly, there is already handling for the similar case of actual tags within the
script
-tag, but it doesn't catch this one.I originally stumbled upon this in
happy-dom@4.1.0
, but it still happens inhappy-dom@5.2.0
.The text was updated successfully, but these errors were encountered: