In Files

Parent

Methods

Hpricot::Comment

@see Hpricot @private

Public Instance Methods

to_haml(tabs, options) click to toggle source

@see Haml::HTML::Node#to_haml

# File lib/haml/html.rb, line 215
def to_haml(tabs, options)
  content = self.content
  if content =~ /\A(\[[^\]]+\])>(.*)<!\[endif\]\z/
    condition = $1
    content = $2
  end

  if content.include?("\n")
    "#{tabulate(tabs)}/#{condition}\n#{parse_text(content, tabs + 1)}"
  else
    "#{tabulate(tabs)}/#{condition} #{content.strip}\n"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.