mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Fixing a string interpolation bug. Thanks, Toons!
git-svn-id: svn://hamptoncatlin.com/haml/trunk@580 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
b83cbfa3b3
commit
e55be25534
2 changed files with 7 additions and 2 deletions
|
@ -887,12 +887,12 @@ END
|
|||
if first.nil?
|
||||
return str.dump
|
||||
elsif first != 0
|
||||
first -= 1
|
||||
first += 1
|
||||
end
|
||||
|
||||
last = str.rindex '}'
|
||||
|
||||
interpolation = str.slice!(first, last + 1)
|
||||
interpolation = str.slice!(first, last - first)
|
||||
str.insert(first, "_haml_interpolation")
|
||||
|
||||
str = str.dump
|
||||
|
|
|
@ -70,6 +70,11 @@ class EngineTest < Test::Unit::TestCase
|
|||
assert_equal("<p>\n Hello World\n</p>\n", render("%p\n == Hello \#{who}", :locals => {:who => 'World'}))
|
||||
end
|
||||
|
||||
def test_double_equals_in_the_middle_of_a_string
|
||||
assert_equal("\"title 'Title'. \"\n",
|
||||
render("== \"title '\#{\"Title\"}'. \""))
|
||||
end
|
||||
|
||||
# Options tests
|
||||
|
||||
def test_stop_eval
|
||||
|
|
Loading…
Add table
Reference in a new issue