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



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

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