mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Fixed nested brackets bug for ==. Thanks to Ryan T Mulligan for pointing it out.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@576 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
3cc372603d
commit
24403b79c7
3 changed files with 16 additions and 2 deletions
|
@ -882,9 +882,21 @@ END
|
|||
end
|
||||
|
||||
def unescape_interpolation(str)
|
||||
str.dump.gsub('\\#', '#').gsub(/\#\{[^\}]+\}/) do |substr|
|
||||
substr.gsub('\\"', '"')
|
||||
first = str.index(/(^|[^\\])\#\{/)
|
||||
|
||||
if first.nil?
|
||||
return str.dump
|
||||
elsif first != 0
|
||||
first -= 1
|
||||
end
|
||||
|
||||
last = str.rindex '}'
|
||||
|
||||
interpolation = str.slice!(first, last + 1)
|
||||
str.insert(first, "_haml_interpolation")
|
||||
|
||||
str = str.dump
|
||||
str.gsub("_haml_interpolation", interpolation)
|
||||
end
|
||||
|
||||
# Counts the tabulation of a line.
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
Embedded? false!
|
||||
Embedded? true!
|
||||
Embedded? true!
|
||||
Embedded? twice! true!
|
||||
<div class='render'><em>wow!</em></div>
|
||||
stuff followed by whitespace
|
||||
<strong>block with whitespace</strong>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
== Embedded? #{true}!
|
||||
- embedded = true
|
||||
== Embedded? #{embedded}!
|
||||
== Embedded? #{"twice! #{true}"}!
|
||||
.render= render :inline => "%em= 'wow!'", :type => :haml
|
||||
= "stuff followed by whitespace"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue