Ticket #124 (new defect)
Opened 9 months ago
queries with spaces in :contains argument return incorrect results
| Reported by: | hagabaka | Owned by: | why |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | ext/hpricot_scan | Version: | |
| Keywords: | :contains space | Cc: |
Description
When a query uses :contains(text), and the text contains a space, the result is incorrect. For example:
require 'open-uri'
page = open('http://code.whytheluckystiff.net/hpricot/') {|f| Hpricot(f)}
(page / 'h2:contains(Tougher)').length
#=> 1 (correct)
(page / 'h2:contains(The Tougher)').length
#=> 12 (incorrect)
(page / 'h2').length
#=> 6 (notice the previous result is more than the total number of h2's)
Note: See
TracTickets for help on using
tickets.
