mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Don't throw errors when text is nested within comments.
Closes gh-384.
This commit is contained in:
parent
10109d4eb1
commit
887d504757
3 changed files with 17 additions and 1 deletions
|
@ -8,6 +8,8 @@
|
|||
* If the ActionView `#capture` helper is used in a Haml template but without any Haml being run in the block,
|
||||
return the value of the block rather than the captured buffer.
|
||||
|
||||
* Don't throw errors when text is nested within comments.
|
||||
|
||||
## 3.1.1
|
||||
|
||||
* Update the vendored Sass to version 3.1.0.
|
||||
|
|
|
@ -146,7 +146,7 @@ END
|
|||
|
||||
@tab_up = nil
|
||||
process_line(@line.text, @line.index) unless @line.text.empty? || @haml_comment
|
||||
if block_opened? || @tab_up
|
||||
if @parent.type != :haml_comment && (block_opened? || @tab_up)
|
||||
@template_tabs += 1
|
||||
@parent = @parent.children.last
|
||||
end
|
||||
|
|
|
@ -382,6 +382,20 @@ SOURCE
|
|||
assert_equal("<p foo='bar'></p>\n", render('%p{:foo => "bar"}', :attr_wrapper => nil))
|
||||
end
|
||||
|
||||
def test_comment_with_crazy_nesting
|
||||
assert_equal(<<HTML, render(<<HAML))
|
||||
foo
|
||||
bar
|
||||
HTML
|
||||
foo
|
||||
-#
|
||||
ul
|
||||
%li{
|
||||
foo
|
||||
bar
|
||||
HAML
|
||||
end
|
||||
|
||||
# Regression tests
|
||||
|
||||
def test_whitespace_nuke_with_both_newlines
|
||||
|
|
Loading…
Add table
Reference in a new issue