Skip to content

Commit

Permalink
Ignore indentation inside multiline comments
Browse files Browse the repository at this point in the history
Fixes #464
  • Loading branch information
norman committed Apr 30, 2012
1 parent 6a80966 commit ce59af5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
Internet Explorer earlier than version 9.
(thanks [Doug Mayer](https://github.com/doxavore))

* Fix multiline silent comments: Haml previously did not allow free indentation
inside multline silent comments.

## 3.1.5 (Unreleased)

* Respect Rails' `html_safe` flag when escaping attribute values
Expand Down
1 change: 1 addition & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ For example:
-#
This won't be displayed
Nor will this
Nor will this.
%p bar

is compiled to:
Expand Down
2 changes: 1 addition & 1 deletion lib/haml/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def parse
@parent = @parent.children.last
end

if !flat? && @next_line.tabs - @line.tabs > 1
if !@haml_comment && !flat? && @next_line.tabs - @line.tabs > 1
raise SyntaxError.new("The line was indented #{@next_line.tabs - @line.tabs} levels deeper than the previous line.", @next_line.index)
end

Expand Down
2 changes: 1 addition & 1 deletion test/haml-spec
Submodule haml-spec updated 2 files
+1 −1 README.md
+5 −0 tests.json

0 comments on commit ce59af5

Please sign in to comment.