Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1ae4a3fe
authored
2013-10-18 01:08:17 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Set the lastIndex in the TextTemplateParser::parse loop to take the delimiter le…
…ngth into account. [#210]
1 parent
14c7e9d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
src/parsers.coffee
src/parsers.coffee
View file @
1ae4a3f
...
...
@@ -33,6 +33,7 @@ class Rivets.TextTemplateParser
@
parse
:
(
template
,
delimiters
)
->
tokens
=
[]
length
=
template
.
length
delimiterOffset
=
delimiters
[
1
].
length
index
=
0
lastIndex
=
0
...
...
@@ -62,6 +63,6 @@ class Rivets.TextTemplateParser
value
=
template
.
slice
(
lastIndex
,
index
).
trim
()
tokens
.
push
type
:
@
types
.
binding
,
value
:
value
lastIndex
=
index
+
2
lastIndex
=
index
+
delimiterOffset
tokens
...
...
Please
register
or
sign in
to post a comment