-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Children and self-closing tags #598
Comments
Self closing tags are not working as expected in Cheerio.
output here is If the html content contained some xml. Browser does not load the broken html. |
Nevermind, I found that using the var $ = cheerio.load('XMLSTRING', {xmlMode: true}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I've stumbled upon a little issue while parsing XML files with cheerio and I do not know whether things have been intended this way or if there is really an underlying problem here.
If you try to retrieve children from a tag containing self-closing children, you will only get the children up to the first self-closing child.
However I noticed that some tags such as
img
that are popularly self-closed, don't abide by the same problem. I therefore think that a white list concerning those is used but does not work for the other ones.Here is a tiny script illustrating the problem (working with cheerio
0.18.0
) :And here is the console output if you run the said script:
The text was updated successfully, but these errors were encountered: