Class: Haml::HTML

Inherits:
Temple::HTML::Fast
  • Object
show all
Defined in:
lib/haml/html.rb

Constant Summary collapse

DEPRECATED_FORMATS =
%i[html4 html5].freeze

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ HTML

Returns a new instance of HTML.



6
7
8
9
10
11
12
# File 'lib/haml/html.rb', line 6

def initialize(opts = {})
  if DEPRECATED_FORMATS.include?(opts[:format])
    opts = opts.dup
    opts[:format] = :html
  end
  super(opts)
end

Instance Method Details

#on_html_condcomment(condition, content, revealed = false)

This dispatcher supports Haml's "revealed" conditional comment.



15
16
17
18
19
20
# File 'lib/haml/html.rb', line 15

def on_html_condcomment(condition, content, revealed = false)
  on_html_comment [:multi,
                   [:static, "[#{condition}]>#{'<!-->' if revealed}"],
                   content,
                   [:static, "#{'<!--' if revealed}<![endif]"]]
end