mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-05-20 16:24:08 +00:00
Fix regexp performance problem introduced in c7b31b02422265e11b68992e58ef5638cf2e568e
This fixes a problem introduced in c7b31b02422265e11b68992e58ef5638cf2e568e. The changes by @tobibeer inadvertently made the regular expression evaluation significantly more expensive because of lookahead. The is less elegant but reverts the performance problem.
This commit is contained in:
parent
537cfcbf79
commit
accd4a1b65
@ -19,9 +19,9 @@ exports.init = function(parser) {
|
|||||||
this.parser = parser;
|
this.parser = parser;
|
||||||
// Regexp to match
|
// Regexp to match
|
||||||
this.matchRegExp = new RegExp(
|
this.matchRegExp = new RegExp(
|
||||||
"~?\\$:\\/(?:" +
|
"~?\\$:\\/[" +
|
||||||
$tw.config.textPrimitives.anyLetter +
|
$tw.config.textPrimitives.anyLetter.substr(1,$tw.config.textPrimitives.anyLetter.length - 2) +
|
||||||
"|[\/._-])+",
|
"\/._-]+",
|
||||||
"mg"
|
"mg"
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user