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 queries and non-space whitespace #854

Closed
flavorjones opened this issue Mar 8, 2013 · 1 comment
Closed

CSS queries and non-space whitespace #854

flavorjones opened this issue Mar 8, 2013 · 1 comment

Comments

@flavorjones
Copy link
Member

doc = Nokogiri::HTML('
<html>
  <body>
    <div class="a 
b"></div>
  </body>
</html>
')

assert_not_nil doc.at_css(".b")

From https://groups.google.com/forum/?fromgroups=#!topic/nokogiri-talk/ICslbeshQhY

@flavorjones
Copy link
Member Author

The generated XPath query is currently

//*[contains(concat(' ', @class, ' '), ' b ')]

I think the right thing to do is this:

//*[contains(concat(' ', normalize-space(@class), ' '), ' b ')]

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

1 participant