Class: Hpricot::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/html2slim/hpricot_monkeypatches.rb

Instance Method Summary collapse

Instance Method Details

#to_slim(lvl = 0) ⇒ Object



12
13
14
15
# File 'lib/html2slim/hpricot_monkeypatches.rb', line 12

def to_slim(lvl=0)
  return nil if to_s.strip.empty?
  ('  ' * lvl) + %(| #{to_s.gsub(/\s+/, ' ')})
end