-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
cheerio convert dom to html is not expect #1006
Comments
Hello @janryWang |
You may want to look as function function |
@mehdi-cit So, how to solve this problem? |
@janryWang |
Same issue here. And quite unfortunate issue... |
I've been searching through all relevant issues and this one is still open. I'm having the same problem as #85, #319, #338, #720 and #866. There doesn't seem to be a solution that satisfies all of them. That is: create a valid attribute but don't touch Unicode characters. const cheerio = require('cheerio');
let html = `<html><head></head><body><div data-options='{"itemselector": ".entry"}'>Äpfel</div></body></html>`
console.log(cheerio.load(html).html());
console.log(cheerio.load(html, { decodeEntities: false }).html()); Output <!--The attribute is valid but Äpfel became Äpfel-->
<html><head></head><body><div data-options="{"itemselector": ".entry"}">Äpfel</div></body></html>
<!--Äpfel are great but the attribute is broken-->
<html><head></head><body><div data-options="{"itemselector": ".entry"}">Äpfel</div></body></html> I think these to attempted to fix the issue cheeriojs/dom-serializer#33 fb55/entities#28 but didn't make it. It'd be sick if we can find a solution. And if it's a breaking change, I'd happily install 2.x instead of 1.x. |
This should be resolved with the latest release! |
check this
The text was updated successfully, but these errors were encountered: