mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Compile boolean attribute for html5
This commit is contained in:
parent
f5c96b9029
commit
72861b1536
2 changed files with 6 additions and 2 deletions
|
@ -35,7 +35,11 @@ module Hamlit
|
|||
|
||||
def compile_static_attributes!(temple, node)
|
||||
node.value[:attributes].sort_by(&:first).each do |name, value|
|
||||
temple << [:html, :attr, name, [:static, value]]
|
||||
if value == true
|
||||
temple << [:html, :attr, name, [:multi]]
|
||||
else
|
||||
temple << [:html, :attr, name, [:static, value]]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -585,7 +585,7 @@ class UglyTest < MiniTest::Test
|
|||
assert_equal haml_result, hamlit_result
|
||||
end
|
||||
|
||||
def _test_HTML_style_tag_with_an_atomic_attribute
|
||||
def test_HTML_style_tag_with_an_atomic_attribute
|
||||
haml = %q{%a(flag)}
|
||||
html = %q{<a flag></a>}
|
||||
locals = {}
|
||||
|
|
Loading…
Add table
Reference in a new issue