Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: raise CSS::SyntaxError if a pseudo-class is not an XPath Name
Some pseudo-classes cannot be converted into an XPath function name, and libxml2 will raise an Nokogiri::XML::XPath::SyntaxError at query-time: nokogiri/xml/searchable.rb:238:in `evaluate': ERROR: Invalid expression: //*:div[nokogiri:-moz-drag-over(.)] (Nokogiri::XML::XPath::SyntaxError) This change moves the error from query-time to parse-time, in the hopes that this is more rescuable (and the error is more descriptive): nokogiri/css/parser_extras.rb:86:in `on_error': unexpected '-' after ':' (Nokogiri::CSS::SyntaxError) Closes #3193
- Loading branch information