-
-
Notifications
You must be signed in to change notification settings - Fork 73
Incorrect decoding of branch of size 1 with a value that's already encoded #852
Copy link
Copy link
Closed
Description
Hello there, I faced a terrible issue using cheerio library
I've created an issue on parse5 library but after further investigations I realised the problem is here
I see two different behaviours on legacy entities in the same case on different entities:
const texts = [
"¢<", // legacy
" <", // legacy
"·<", // legacy
"&ensp<", // not legacy
];
for (const text of texts) {
console.log(`"${text}"`, `"${decodeHTML(text)}"`);
}I'd expect the following output of this:
"¢<" "¢<"
" <" " <"
"·<" "·<"
"&ensp<" "&ensp<"but the actual output is:
"¢<" "¢<"
" <" "Á"
"·<" "·<"
"&ensp<" "&ensp<"I tried to solve it by my own, but unfortunately need too much time for it due to the lack of byte operations knowledge
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels