You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using 1.0.0-rc.2 release version. I have html entity such as > and would not like that decoded when I use .html(). I had loaded the html object this way:
This is a bug because of different behavior of parse5 and htmlparse2, if you set decodeEntities to false, dom-serializer won't encode them, and htmlparse2 won't decode too. But when cheerio switches to parse2, it always decode entities, which leads into this problem. If you let dom-serializer encode entities, other chars like CJK will be encode too, which leads into other problems. Also, it's really confusing because sometimes cheerio chooses parse5 and sometimes cheerio chooses htmlparser2
This is a long-time problem, and I am feeling bad that no cheerio maintainer makes a decision to solve this, it's really annoying, we should keep a correct behavior instead of keeping compatible to old incorrect behavior, I have submitted a solution here but no one replied to my PR. In a word, to encode all entities is not a good choice, cheerio is used to parse like DOM, not encoder.
I am using 1.0.0-rc.2 release version. I have html entity such as > and would not like that decoded when I use .html(). I had loaded the html object this way:
The output is decoded to >. This is not correct.
When I used the 0.22.0 release this issue does not occur. Can you please set the latest stable release as 0.22.0 please.
The text was updated successfully, but these errors were encountered: