Module Haml::HTML::
In: lib/haml/html.rb
Engine Error SyntaxError Buffer StandardError ActionViewExtensions Generic CSS2Sass HTML2Haml HamlSass Haml Sass Template HTML lib/haml/template.rb lib/haml/error.rb lib/haml/engine.rb lib/haml/html.rb lib/haml/buffer.rb Version Util Precompiler ActionViewExtensions Helpers Base Filters lib/haml/exec.rb Exec Haml dot/m_15_0.png

Methods

Public Instance methods

Returns the Haml representation of the given node, at the given tabulation.

[Source]

    # File lib/haml/html.rb, line 46
46:       def to_haml(tabs = 0)
47:         parse_text(self.to_s, tabs)
48:       end

Private Instance methods

[Source]

    # File lib/haml/html.rb, line 56
56:       def parse_text(text, tabs)
57:         text.strip!
58:         if text.empty?
59:           String.new
60:         else
61:           lines = text.split("\n")
62: 
63:           lines.map do |line|
64:             line.strip!
65:             "#{tabulate(tabs)}#{'\\' if Haml::Engine::SPECIAL_CHARACTERS.include?(line[0])}#{line}\n"
66:           end.join
67:         end
68:       end

[Source]

    # File lib/haml/html.rb, line 52
52:       def tabulate(tabs)
53:         '  ' * tabs
54:       end

[Validate]