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

Fix an error with '= ... do' with :ugly.

This commit is contained in:
Nathan Weizenbaum 2009-01-23 10:48:35 -08:00
parent bfb17c0cc2
commit 90b8154bde
2 changed files with 20 additions and 13 deletions

View file

@ -340,7 +340,7 @@ END
push_silent "#{temp} = #{text}"
newline_now
push_and_tabulate([:loud, "_erbout << #{no_format ? "#{temp}.to_s" : out}"])
push_and_tabulate([:loud, "_erbout << #{no_format ? "#{temp}.to_s;" : out}"])
end
# Causes <tt>text</tt> to be evaluated, and Haml::Helpers#find_and_flatten

View file

@ -215,8 +215,19 @@ SOURCE
render("%p{:foo => 'bar', :bar => false, :baz => 'false'}", :format => :xhtml))
end
def test_both_whitespace_nukes_work_together
assert_equal(<<RESULT, render(<<SOURCE))
<p><q>Foo
Bar</q></p>
RESULT
%p
%q><= "Foo\\nBar"
SOURCE
end
# Regression tests
def test_whitespace_nuke_with_both_newlines
# Regression test
assert_equal("<p>foo</p>\n", render('%p<= "\nfoo\n"'))
assert_equal(<<HTML, render(<<HAML))
<p>
@ -228,17 +239,6 @@ HTML
HAML
end
def test_both_whitespace_nukes_work_together
assert_equal(<<RESULT, render(<<SOURCE))
<p><q>Foo
Bar</q></p>
RESULT
%p
%q><= "Foo\\nBar"
SOURCE
end
# Mostly a regression test
def test_both_case_indentation_work_with_deeply_nested_code
result = <<RESULT
<h2>
@ -265,6 +265,13 @@ HAML
HAML
end
def test_equals_block_with_ugly
assert_equal("foo\n", render(<<HAML))
= capture_haml do
foo
HAML
end
# HTML escaping tests
def test_ampersand_equals_should_escape