Changeset 92
- Timestamp:
- 12/26/2006 21:07:03 (2 years ago)
- Location:
- trunk/lib/hpricot
- Files:
-
- 2 modified
-
tag.rb (modified) (1 diff)
-
traverse.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/hpricot/tag.rb
r91 r92 60 60 elsif self.name == 'a' and self.has_attribute?('href') 61 61 "#{super} [#{self['href']}]" 62 elsif self.name == 'img' and self.has_attribute?('src') 63 "[img:#{self['src']}]" 62 64 else 63 65 super -
trunk/lib/hpricot/traverse.rb
r91 r92 103 103 def to_plain_text 104 104 if respond_to? :children 105 children.map { |x| x.to_plain_text }.join.strip 105 children.map { |x| x.to_plain_text }.join.strip.gsub(/\n{2,}/, "\n\n") 106 106 end 107 107 end … … 183 183 p 184 184 end 185 end 186 187 def node_position 188 parent.children.index(self) 185 189 end 186 190
