1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 20:10:03 +00:00

Catch syntax errors in regexp filters

This commit is contained in:
Astrid Elocson 2015-01-23 14:32:57 +00:00
parent f4005871b4
commit 8d9f1e7477

View File

@ -41,7 +41,11 @@ exports.regexp = function(source,operator,options) {
regexpString = regexpString.substr(0,regexpString.length - match[0].length); 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 // Process the incoming tiddlers
if(operator.prefix === "!") { if(operator.prefix === "!") {
source(function(tiddler,title) { source(function(tiddler,title) {