mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 00:50:28 +00:00
Freelinks plugin: Add support for ignoring case
This commit is contained in:
parent
5eee11beed
commit
1f354a972e
@ -1,4 +1,8 @@
|
||||
title: $:/plugins/tiddlywiki/freelinks/macros/view
|
||||
tags: $:/tags/Macro/View
|
||||
|
||||
<$set name="tv-freelinks" value={{$:/config/Freelinks/Enable}}/>
|
||||
<$set name="tv-freelinks" value={{$:/config/Freelinks/Enable}}>
|
||||
|
||||
<$set name="tv-freelinks-ignore-case" value={{$:/config/Freelinks/IgnoreCase}}/>
|
||||
|
||||
</$set>
|
@ -1,3 +1,5 @@
|
||||
title: $:/plugins/tiddlywiki/freelinks/settings
|
||||
|
||||
<$checkbox tiddler="$:/config/Freelinks/Enable" field="text" checked="yes" unchecked="no" default="no"> <$link to="$:/config/Freelinks/Enable">Enable freelinking within tiddler view templates</$link> </$checkbox>
|
||||
|
||||
<$checkbox tiddler="$:/config/Freelinks/IgnoreCase" field="text" checked="yes" unchecked="no" default="no"> <$link to="$:/config/Freelinks/IgnoreCase">Ignore case</$link> </$checkbox>
|
||||
|
@ -79,9 +79,10 @@ TextNodeWidget.prototype.execute = function() {
|
||||
reparts.push("(\\b" + $tw.utils.escapeRegExp(title) + "\\b)");
|
||||
}
|
||||
});
|
||||
var ignoreCase = self.getVariable("tv-freelinks-ignore-case",{defaultValue:"no"}).trim() === "yes";
|
||||
return {
|
||||
titles: titles,
|
||||
regexp: new RegExp(reparts.join("|"),"")
|
||||
regexp: new RegExp(reparts.join("|"),ignoreCase ? "i" : "")
|
||||
};
|
||||
});
|
||||
// Repeatedly linkify
|
||||
|
Loading…
Reference in New Issue
Block a user