Permalink
Browse files

Fix failing test cases

  • Loading branch information...
1 parent f414a6d commit de3409f984775a0930e6925d62471b8b42a9aadf @judofyr judofyr committed Mar 7, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/mustache/parser.rb
View
@@ -117,6 +117,7 @@ def scan_tags
# of a new line.
unless start_of_line
@result << [:static, padding] unless padding.empty?
+ pre_match_position += padding.length
padding = ''
end
@@ -140,7 +141,6 @@ def scan_tags
fetch = [:mustache, :fetch, content.split('.')]
prev = @result
- last_index = @result.size
# Based on the sigil, do what needs to be done.
case type
@@ -192,7 +192,7 @@ def scan_tags
# If this tag was the only non-whitespace content on this line, strip
# the remaining whitespace. If not, but we've been hanging on to padding
# from the beginning of the line, re-insert the padding as static text.
- if start_of_line
+ if start_of_line && !@scanner.eos?
if @scanner.peek(2) =~ /\r?\n/ && SKIP_WHITESPACE.include?(type)
@scanner.skip(/\r?\n/)
else

0 comments on commit de3409f

Please sign in to comment.