Open instanceofme opened 7 years ago
Hmm maybe this is actually more of a domtosource issue? Or even further down the dependency tree…
Indeed: domtosource -> cheerio -> htmlparser2.
Trying this in htmlparser2's live demo yields the incorrect DOM tree.
But actually it seems that there is a recognizeSelfClosing
option for this in the parser. ~Not sure if it's exposed by cheerio though.~
Yes it is! The load function accepts htmlparser2 options.
These parsing options are taken directly from htmlparser2, therefore any options that can be used in htmlparser2 are valid in cheerio as well.
Would it be possible to use this option? or to expose it?
E.g.
.a .b
will incorrectly find 2 results in the following case: