Fix CSS selector parser when only the :not pseudo class #859

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@ykzts
Contributor
ykzts commented Mar 12, 2013

before:

1.9.3-p385 :001 > Nokogiri::CSS.xpath_for ':not(.a)'
Nokogiri::CSS::SyntaxError: unexpected '.' after ':not('
        from /Users/ykzts/work/nokogiri/lib/nokogiri/css/parser_extras.rb:87:in `on_error'
        from (eval):3:in `_racc_do_parse_c'
        from (eval):3:in `do_parse'
        from /Users/ykzts/work/nokogiri/lib/nokogiri/css/parser_extras.rb:62:in `parse'
        from /Users/ykzts/work/nokogiri/lib/nokogiri/css/parser_extras.rb:79:in `xpath_for'
        from /Users/ykzts/work/nokogiri/lib/nokogiri/css.rb:23:in `xpath_for'
        from (irb):1
        from /Users/ykzts/.rvm/rubies/ruby-1.9.3-p385/bin/irb:16:in `<main>'

after:

1.9.3-p385 :001 > Nokogiri::CSS.xpath_for ':not(.a)'
 => ["//*[not(contains(concat(' ', normalize-space(@class), ' '), ' a '))]"]
@aruprakshit

My bad I didn't get the difference of the codes taged as before and after. But in my case both are throwing error.

@ykzts
Contributor
ykzts commented Jul 5, 2013

Fixed in #887 .

@ykzts ykzts closed this Jul 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment