-
-
Notifications
You must be signed in to change notification settings - Fork 250
Incorrect behaviour on html entities without ending semicolon #581
Copy link
Copy link
Closed
Description
Parsing started behave incorrectly since v7, was working correctly on v6
how to reproduce:
const cheerio = require("cheerio");
const html = `<div class="contacts">
<h3>Contacts</h3>
<p>Website: <a href="http://some.link/here" target="_blank">some.link</a></p>
<p>Address: <span>some address</span></p>
</div>`;
const $ = cheerio.load(html);
const contacts = $("div.contacts p")
.map((i, p) => $(p).text())
.get();
console.log(contacts);expected output:
[
'Website: some.link',
'Address: some address'
]actual output:
[
'Website:Áa href="http://some.link/here" target="_blank">some.link',
'Address:Áspan>some address'
]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels