1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Merge pull request #1414 from aelocson/regexp-exception

Catch syntax errors in regexp filters
This commit is contained in:
Jeremy Ruston 2015-01-26 20:55:58 +00:00
commit 1afbd4c1f4

View File

@ -41,7 +41,11 @@ exports.regexp = function(source,operator,options) {
regexpString = regexpString.substr(0,regexpString.length - match[0].length);
}
}
regexp = new RegExp(regexpString,flags);
try {
regexp = new RegExp(regexpString,flags);
} catch(e) {
return ["" + e];
}
// Process the incoming tiddlers
if(operator.prefix === "!") {
source(function(tiddler,title) {