Class: Hamlit::HTML::Pretty
- Inherits:
-
Temple::HTML::Pretty
- Object
- Temple::HTML::Pretty
- Hamlit::HTML::Pretty
show all
- Includes:
- Concerns::Deprecation
- Defined in:
- lib/hamlit/html/pretty.rb
Constant Summary
Concerns::Deprecation::DEPCATED_OPTIONS
Instance Method Summary
collapse
#initialize, #rewrite_deprecated_options
Instance Method Details
#call(exp) ⇒ Object
13
14
15
16
17
|
# File 'lib/hamlit/html/pretty.rb', line 13
def call(exp)
result = super(exp)
result << [:static, "\n"] if @added_newline
result
end
|
#on_html_tag(name, attrs, content = nil) ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/hamlit/html/pretty.rb', line 28
def on_html_tag(name, attrs, content = nil)
if content.is_a?(Array) && content.first != :multi
return parse_oneline_tag(name, attrs, content)
end
super
end
|
#on_static(exp) ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/hamlit/html/pretty.rb', line 19
def on_static(exp)
if exp == "\n"
@added_newline = true
[:static, '']
else
[:static, exp]
end
end
|