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

use single quotes for values that contain double quotes #25

Closed
wants to merge 1 commit into from

Conversation

OverFlow636
Copy link

This will use single quotes for attributes instead of double quotes, when the value contains double quotes.

Fix for cheeriojs/cheerio#720

@OverFlow636
Copy link
Author

@fb55 any chance you can take a look at this? Thanks!

@crystalline
Copy link

+1 had the same problem with .. style = 'font-family: "Geneva";'> ... being serialized to style = "font-family: "Geneva";">
OverFlow636's patch fixed the problem

@briantjacobs
Copy link

This also fixed my problem on a page that had JSON within an html element within single quotes:

<div data-platform-social-links='[{"socialLink":{"icon":"icongs-facebook","class":"addthis_button_facebook","analyticsEvent":"Facebook"}}]'></div>

@Matthalp-zz
Copy link

Matthalp-zz commented Oct 14, 2016

This patch looks legitimate and addresses an important issue for parsing many Websites (e.g. msn.com and many others in the Alexa Top 100). Is there a reason the merge is being held off?

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

Successfully merging this pull request may close these issues.

4 participants