Skip to content
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

Unexpected behaviour with custom tag "line" #746

Closed
yfp opened this issue Sep 6, 2015 · 3 comments · Fixed by #985
Closed

Unexpected behaviour with custom tag "line" #746

yfp opened this issue Sep 6, 2015 · 3 comments · Fixed by #985

Comments

@yfp
Copy link

yfp commented Sep 6, 2015

cheerio.load("<line>text</line>").html()

returns "<line></line>text", expected "<line>text</line>". The parsed tree is wrong, it's not just the html output bug.

@pyhedgehog
Copy link

htmlparser2 treats <line> as void SVG element.

You can "fix" it by passing option xmlMode:

var cheerio = require('cheerio');
console.log(cheerio.load("<line>text</line>", {xmlMode:true}).html());

@yfp
Copy link
Author

yfp commented Sep 8, 2015

Thanks. That helps.

@fb55
Copy link
Member

fb55 commented Dec 22, 2020

Fixed by #985

@fb55 fb55 closed this as completed Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants