Module: Hpricot::Node

Defined in:
lib/haml/html.rb

Overview

Haml monkeypatches various Hpricot classes to add methods for conversion to Haml.

Instance Method Summary collapse

Instance Method Details

#to_haml(tabs, options) ⇒ Object

Returns the Haml representation of the given node.

Parameters:

  • tabs (Fixnum)

    The indentation level of the resulting Haml.

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :rhtml (Boolean) — default: false

    Whether or not to parse ERB’s ‘<%= %>` and `<% %>` into Haml’s ‘=` and `-`

  • :xhtml (Boolean) — default: false

    Whether or not to parse the HTML strictly as XHTML



56
57
58
# File 'lib/haml/html.rb', line 56

def to_haml(tabs, options)
  parse_text(self.to_s, tabs)
end