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:
parent
bfb17c0cc2
commit
90b8154bde
2 changed files with 20 additions and 13 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue