class Hpricot::Elem

def to_plain_text

def to_plain_text
  if self.name == 'br'
    "\n"
  elsif self.name == 'p'
    "\n\n" + super + "\n\n"
  elsif self.name == 'a' and self.has_attribute?('href')
    "#{super} [#{self['href']}]"
  elsif self.name == 'img' and self.has_attribute?('src')
    "[img:#{self['src']}]"
  else
    super
  end
end