1
0
Fork 0
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:
Takashi Kokubun 2015-10-13 01:25:12 +09:00
parent f5c96b9029
commit 72861b1536
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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 = {}