innerHTML
parser interprets /
in unquoted element attributes incorrectly
#999
Labels
bug
Something isn't working
Describe the bug
When setting
el.innerHTML
, the resulting DOM is incorrect when an element's attribute value is unquoted and contains a forward slash. Rather than the slash becoming part of the value, it's removed and the remaining value is tokenized into a separate attribute.To Reproduce
Steps to reproduce the behavior:
index.test.ts
:Expected behavior
In the repro, both tests should pass. Forward slashes should be included as part of the attribute value.
Screenshots
Failing test output:
Device:
Linux 6.4.4-arch1-1 x86_64
happy-dom
version:10.5.2
Additional context
Since under the hood
XMLParser
is used to parse when settinginnerHTML
, there will be many other characters which exhibit the same behavior. However, forward slashes are the biggest impact for me as I'm running into issues with setting URLs in anchor href tags.The text was updated successfully, but these errors were encountered: