mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 18:00:26 +00:00
Simplify freelinks regexp
As discussed here: https://github.com/Jermolene/TiddlyWiki5/issues/6029#issuecomment-917612980
This commit is contained in:
parent
e9e5d37ff0
commit
f725123690
@ -81,12 +81,13 @@ TextNodeWidget.prototype.execute = function() {
|
||||
$tw.utils.each(sortedTitles,function(title) {
|
||||
if(title.substring(0,3) !== "$:/") {
|
||||
titles.push(title);
|
||||
reparts.push("(\\b" + $tw.utils.escapeRegExp(title) + "\\b)");
|
||||
reparts.push("(" + $tw.utils.escapeRegExp(title) + ")");
|
||||
}
|
||||
});
|
||||
var regexpStr = "\\b(?:" + reparts.join("|") + ")\\b";
|
||||
return {
|
||||
titles: titles,
|
||||
regexp: new RegExp(reparts.join("|"),ignoreCase ? "i" : "")
|
||||
regexp: new RegExp(regexpStr,ignoreCase ? "i" : "")
|
||||
};
|
||||
});
|
||||
// Repeatedly linkify
|
||||
|
Loading…
Reference in New Issue
Block a user