mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix #2157 (issues with = in template args)
This commit is contained in:
@@ -102,6 +102,8 @@ Tinytest.add("spacebars - stache tags", function (test) {
|
||||
|
||||
run('{{foo.[]/[]}}', {type: 'DOUBLE', path: ['foo', '', ''],
|
||||
args: []});
|
||||
run('{{x foo.[=]}}', {type: 'DOUBLE', path: ['x'],
|
||||
args: [['PATH', ['foo', '=']]]});
|
||||
run('{{[].foo}}', "Path can't start with empty string");
|
||||
|
||||
run('{{foo null}}', {type: 'DOUBLE', path: ['foo'],
|
||||
@@ -159,6 +161,9 @@ Tinytest.add("spacebars - stache tags", function (test) {
|
||||
run('{{./this}}', "Can only use");
|
||||
run('{{../this}}', "Can only use");
|
||||
|
||||
run('{{foo "="}}', {type: 'DOUBLE', path: ['foo'],
|
||||
args: [['STRING', '=']]});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ TemplateTag.parse = function (scannerOrString) {
|
||||
// Result is either the keyword matched, or null
|
||||
// if we're not at a keyword argument position.
|
||||
var scanArgKeyword = function () {
|
||||
var match = /^([^\{\}\(\)\>#=\s]+)\s*=\s*/.exec(scanner.rest());
|
||||
var match = /^([^\{\}\(\)\>#=\s"'\[\]]+)\s*=\s*/.exec(scanner.rest());
|
||||
if (match) {
|
||||
scanner.pos += match[0].length;
|
||||
return match[1];
|
||||
|
||||
Reference in New Issue
Block a user