1ae4a3fe by Michael Richards

Set the lastIndex in the TextTemplateParser::parse loop to take the delimiter le…

…ngth into account. [#210]
1 parent 14c7e9d1
...@@ -33,6 +33,7 @@ class Rivets.TextTemplateParser ...@@ -33,6 +33,7 @@ class Rivets.TextTemplateParser
33 @parse: (template, delimiters) -> 33 @parse: (template, delimiters) ->
34 tokens = [] 34 tokens = []
35 length = template.length 35 length = template.length
36 delimiterOffset = delimiters[1].length
36 index = 0 37 index = 0
37 lastIndex = 0 38 lastIndex = 0
38 39
...@@ -62,6 +63,6 @@ class Rivets.TextTemplateParser ...@@ -62,6 +63,6 @@ class Rivets.TextTemplateParser
62 63
63 value = template.slice(lastIndex, index).trim() 64 value = template.slice(lastIndex, index).trim()
64 tokens.push type: @types.binding, value: value 65 tokens.push type: @types.binding, value: value
65 lastIndex = index + 2 66 lastIndex = index + delimiterOffset
66 67
67 tokens 68 tokens
......