e98e03ef by Michael Richards

Build 0.6.2.

1 parent b80c66f5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 "name": "rivets", 2 "name": "rivets",
3 "repo": "mikeric/rivets", 3 "repo": "mikeric/rivets",
4 "description": "Declarative data binding + templating solution.", 4 "description": "Declarative data binding + templating solution.",
5 "version": "0.6.1", 5 "version": "0.6.2",
6 "keywords": ["data binding", "templating"], 6 "keywords": ["data binding", "templating"],
7 "scripts": ["dist/rivets.js"], 7 "scripts": ["dist/rivets.js"],
8 "main": "dist/rivets.js", 8 "main": "dist/rivets.js",
......
1 // Rivets.js 1 // Rivets.js
2 // version: 0.6.1 2 // version: 0.6.2
3 // author: Michael Richards 3 // author: Michael Richards
4 // license: MIT 4 // license: MIT
5 (function() { 5 (function() {
...@@ -671,10 +671,9 @@ ...@@ -671,10 +671,9 @@
671 }; 671 };
672 672
673 TextTemplateParser.parse = function(template, delimiters) { 673 TextTemplateParser.parse = function(template, delimiters) {
674 var delimiterOffset, index, lastIndex, lastToken, length, substring, tokens, value; 674 var index, lastIndex, lastToken, length, substring, tokens, value;
675 tokens = []; 675 tokens = [];
676 length = template.length; 676 length = template.length;
677 delimiterOffset = delimiters[1].length;
678 index = 0; 677 index = 0;
679 lastIndex = 0; 678 lastIndex = 0;
680 while (lastIndex < length) { 679 while (lastIndex < length) {
...@@ -692,10 +691,10 @@ ...@@ -692,10 +691,10 @@
692 value: template.slice(lastIndex, index) 691 value: template.slice(lastIndex, index)
693 }); 692 });
694 } 693 }
695 lastIndex = index + 2; 694 lastIndex = index + delimiters[0].length;
696 index = template.indexOf(delimiters[1], lastIndex); 695 index = template.indexOf(delimiters[1], lastIndex);
697 if (index < 0) { 696 if (index < 0) {
698 substring = template.slice(lastIndex - 2); 697 substring = template.slice(lastIndex - delimiters[1].length);
699 lastToken = tokens[tokens.length - 1]; 698 lastToken = tokens[tokens.length - 1];
700 if ((lastToken != null ? lastToken.type : void 0) === this.types.text) { 699 if ((lastToken != null ? lastToken.type : void 0) === this.types.text) {
701 lastToken.value += substring; 700 lastToken.value += substring;
...@@ -712,7 +711,7 @@ ...@@ -712,7 +711,7 @@
712 type: this.types.binding, 711 type: this.types.binding,
713 value: value 712 value: value
714 }); 713 });
715 lastIndex = index + delimiterOffset; 714 lastIndex = index + delimiters[1].length;
716 } 715 }
717 } 716 }
718 return tokens; 717 return tokens;
......
1 { 1 {
2 "name": "rivets", 2 "name": "rivets",
3 "description": "Declarative data binding + templating solution.", 3 "description": "Declarative data binding + templating solution.",
4 "version": "0.6.1", 4 "version": "0.6.2",
5 "author": "Michael Richards", 5 "author": "Michael Richards",
6 "url": "http://rivetsjs.com", 6 "url": "http://rivetsjs.com",
7 "main": "./dist/rivets.js", 7 "main": "./dist/rivets.js",
......