diff --git a/lib/haml/html.rb b/lib/haml/html.rb index 2e499f58..d0ee9b32 100644 --- a/lib/haml/html.rb +++ b/lib/haml/html.rb @@ -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) diff --git a/test/haml/html2haml_test.rb b/test/haml/html2haml_test.rb index 09bc9c04..dbd766e1 100644 --- a/test/haml/html2haml_test.rb +++ b/test/haml/html2haml_test.rb @@ -70,6 +70,11 @@ class Html2HamlTest < Test::Unit::TestCase assert_equal %(%div{ :class => "\#{12} + \#{13}" }\n Math is super), render_rhtml(%Q{