From 82c0152e04c3fa7c3514b65694362bff991c7535 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Wed, 14 Jan 2015 20:06:51 +0000 Subject: [PATCH 1/2] Fix #1346: Quotes around filter steps --- core/modules/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/filters.js b/core/modules/filters.js index 15dde5f75..4c46b5283 100644 --- a/core/modules/filters.js +++ b/core/modules/filters.js @@ -108,7 +108,7 @@ exports.parseFilter = function(filterString) { p = 0, // Current position in the filter string match; var whitespaceRegExp = /(\s+)/mg, - operandRegExp = /((?:\+|\-)?)(?:(\[)|("(?:[^"])*")|('(?:[^'])*')|([^\s\[\]]+))/mg; + operandRegExp = /((?:\+|\-)?)(?:(\[)|(?:"([^"]*)")|(?:'([^']*)')|([^\s\[\]]+))/mg; while(p < filterString.length) { // Skip any whitespace whitespaceRegExp.lastIndex = p; From 07c1dcb685c40b6d2a801d67bd9116cf375f1733 Mon Sep 17 00:00:00 2001 From: Astrid Elocson Date: Wed, 14 Jan 2015 20:09:15 +0000 Subject: [PATCH 2/2] Improve a couple of comments --- core/modules/filters.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/filters.js b/core/modules/filters.js index 4c46b5283..8fbcac587 100644 --- a/core/modules/filters.js +++ b/core/modules/filters.js @@ -13,8 +13,8 @@ Adds tiddler filtering methods to the $tw.Wiki object. "use strict"; /* -Parses an operation within a filter string - results: Array of array of operator nodes into which results should be inserted +Parses an operation (i.e. a run) within a filter string + operators: Array of array of operator nodes into which results should be inserted filterString: filter string p: start position within the string Returns the new start position, after the parsed operation @@ -202,6 +202,7 @@ exports.compileFilter = function(filterString) { if(operator.variable) { operand = widget.getVariable(operator.operand,{defaultValue: ""}); } + // Invoke the appropriate filteroperator module results = operatorFunction(accumulator,{ operator: operator.operator, operand: operand,