Class: Hpricot::Comment

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

Instance Method Summary collapse

Instance Method Details

#to_slim(lvl = 0) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/html2slim/hpricot_monkeypatches.rb', line 20

def to_slim(lvl=0)
  # For SHTML <!--#include virtual="foo.html" -->
  if self.content =~ /include (file|virtual)="(.+)"/
    ('  ' * lvl) + "= render '#{$~[2]}'"
  else
    nil
  end
end