Module: SlimText

Included in:
Hpricot::CData, Hpricot::Text
Defined in:
lib/html2slim/hpricot_monkeypatches.rb

Instance Method Summary collapse

Instance Method Details

#to_slim(lvl = 0) ⇒ Object



6
7
8
9
# File 'lib/html2slim/hpricot_monkeypatches.rb', line 6

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