Permalink
Browse files

Tweaking the parser to pass the new specs.

  • Loading branch information...
pvande committed Mar 5, 2011
1 parent 2d49dae commit 8118091cbad66d7a4d504f65964c62629a4fd064
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mustache/parser.rb
View
@@ -194,7 +194,7 @@ def scan_tags
# from the beginning of the line, re-insert the padding as static text.
if start_of_line
if @scanner.peek(2) =~ /\r?\n/ && SKIP_WHITESPACE.include?(type)
- @scanner.skip(/[ \t]*\n/)
+ @scanner.skip(/[ \t]*\r?\n/)
else
prev.insert(last_index, [:static, padding]) unless padding.empty?
end

2 comments on commit 8118091

@judofyr

This comment has been minimized.

Show comment Hide comment
@judofyr

judofyr Mar 5, 2011

Contributor

One question: if we peek for exactly a newline, why do we need to skip [ \t]*?

Contributor

judofyr replied Mar 5, 2011

One question: if we peek for exactly a newline, why do we need to skip [ \t]*?

@pvande

This comment has been minimized.

Show comment Hide comment
@pvande

pvande Mar 6, 2011

Contributor

That's a great question...

Contributor

pvande replied Mar 6, 2011

That's a great question...

Please sign in to comment.