Ticket #148 (new defect)
e.swap('') causes subsequent elements to be skipped in traverse_element()
| Reported by: | davidroyalmartin | Owned by: | why |
|---|---|---|---|
| Priority: | major | Milestone: | 0.6 |
| Component: | lib/hpricot | Version: | |
| Keywords: | Cc: |
Description (last modified by davidroyalmartin) (diff)
swap with empty string causes the problem. swap with a space does not. this must be a bug? here is code that exhibits the problem. i'm using hpricot 0.6.
def hpricot_bug_report()
s = '<!--comment--><a>x</a>'
doc = Hpricot(s)
doc.traverse_element do |e|
if e.elem?
puts "elem #{e}"
elsif e.comment?
puts "comment #{e}"
e.swap('') # elem not visited
# e.swap(' ') # elem still visited
end
end
end
Change History
Note: See
TracTickets for help on using
tickets.
