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

CSS class selectors are not working with special characters #922

Closed
the8472 opened this issue Jun 10, 2013 · 3 comments
Closed

CSS class selectors are not working with special characters #922

the8472 opened this issue Jun 10, 2013 · 3 comments

Comments

@the8472
Copy link

the8472 commented Jun 10, 2013

Using nokogiri 1.5.9

doc = Nokogiri::HTML("<html><body><div class='foo/bar'></div></body></html>")
doc.css('.foo\2F bar') #  => []
doc.css('.foo\/bar') #  => []
doc.css('.foo\00002Fbar') #  => []

According to the HTML5 spec any unicode sequence not containing space characters is a valid class name. And according to the CSS spec it should be possible to use escapes in selectors to match such sequences.

http://www.w3.org/TR/CSS2/syndata.html#characters
http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes

@twalpole
Copy link
Contributor

PR #1303 should fix this - been waiting for a while though

@flavorjones flavorjones added this to the 1.6.8 milestone Sep 21, 2015
@flavorjones
Copy link
Member

PR #1303 is targetted for 1.6.8, so labeling this story with that milestone.

@flavorjones
Copy link
Member

PR merged to master.

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

No branches or pull requests

3 participants