1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

html2haml: fix whitespace eating erb tags

This commit is contained in:
Mislav Marohnić 2008-10-16 23:37:08 +02:00
parent 06212371fc
commit 8a263c4f1e
2 changed files with 6 additions and 1 deletions

View file

@ -25,7 +25,7 @@ module Haml
if @@options[:rhtml]
match_to_html(template, /<%=(.*?)-?%>/m, 'loud')
match_to_html(template, /<%(.*?)-?%>/m, 'silent')
match_to_html(template, /<%-?(.*?)-?%>/m, 'silent')
end
method = @@options[:xhtml] ? Hpricot.method(:XML) : method(:Hpricot)

View file

@ -70,6 +70,11 @@ class Html2HamlTest < Test::Unit::TestCase
assert_equal %(%div{ :class => "\#{12} + \#{13}" }\n Math is super),
render_rhtml(%Q{<div class="<%= 12 %> + <%= 13 %>">Math is super</div>})
end
def test_whitespace_eating_erb_tags
assert_equal %(- form_for),
render_rhtml(%Q{<%- form_for -%>})
end
protected