Skip to content
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

DOMParser().parseFromString(...) doesn't decode html entities #908

Closed
mreinstein opened this issue May 11, 2023 · 3 comments · Fixed by #912
Closed

DOMParser().parseFromString(...) doesn't decode html entities #908

mreinstein opened this issue May 11, 2023 · 3 comments · Fixed by #912
Assignees
Labels
bug Something isn't working

Comments

@mreinstein
Copy link

mreinstein commented May 11, 2023

setup code for happy-dom:

const window = new Window();
const doc = new window.DOMParser().parseFromString('<p>here is some</p> html el&#225;stica ', 'text/html');
console.log('text:', doc.body.textContent);

output:

text: here is some html el&#225;stica

similar code, in a browser:

const doc = new window.DOMParser().parseFromString('<p>here is some</p> html el&#225;stica ', 'text/html');
console.log('text:', doc.body.textContent);

output:

text: here is some html elástica 

le bug? tested with happy-dom@9.12.0 and chrome@113

@mreinstein mreinstein added the bug Something isn't working label May 11, 2023
@capricorn86 capricorn86 self-assigned this May 11, 2023
capricorn86 added a commit that referenced this issue May 11, 2023
… Adds support for escaping text to XMLSerializer.serializeToString().
capricorn86 added a commit that referenced this issue May 11, 2023
…tring-doesnt-decode-html-entities

#908@minor: Adds support for endoing HTML entities to the XML parser.…
@capricorn86
Copy link
Owner

Thank you for reporting @mreinstein! 🙂

I have implemented a fix for the issue now.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v9.16.0

@mreinstein
Copy link
Author

wow, the speed!

@adaboese
Copy link

This change seems to cause a few issues #944 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants