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

Parser doesn't work correctly if greater than appears in attribute value #62

Closed
scriby opened this issue Jun 15, 2012 · 6 comments
Closed

Comments

@scriby
Copy link

scriby commented Jun 15, 2012

<div class="add-question first" data-bind="visible: questionSets()[0].questions().length > 0">

If I read that in with cheerio and get the html, the tag ends at the first greater than sign.

Chris

@balupton
Copy link

Yikes... any idea when this will be fixed? I'm evaluating using cheerio in DocPad for some of the plugins, but this seems scary.

@davidgildea
Copy link

HI Guys,

I have noticed the same problem myself. In particular where any HTML is stored inside and attribute. So credit tags in a title attribute get parsed instead of being escaped and ignored.
So in this example

title data become a 1 double quote and credit becomes a child element of a

Thanks
Dave.

Great work by the way, cheerio is fantastic.

@mlegenhausen
Copy link

+1
We are using Angular.js and have greater than signs in many params. This is really a bug.

@sindresorhus
Copy link
Contributor

@matthewmueller ping. This is a huge problem for projects that uses two-way data-binding solutions like Angular/Knockout/etc which does inline logic.

@scriby
Copy link
Author

scriby commented Jan 14, 2013

Yes. We use knockout and it was a big issue.

I ended up having to write a pre-processor to update them to HTML entities. It wasn't crazy hard, but a little complicated. I would release the code if I could, but my company owns it.

@matthewmueller
Copy link
Member

this is a known issue and it's being tracked here: https://github.com/fb55/node-htmlparser/issues/14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants