mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Make prefix/suffix operators be case sensitive
I think it was a mistake for them to be case insensitive in the first place. https://groups.google.com/d/topic/tiddlywiki/dzpFsRCC5D8/discussion If case insensitivity is required then regexps can be used instead.
This commit is contained in:
parent
748caecca0
commit
112a9a95d9
@ -19,13 +19,13 @@ exports.prefix = function(source,operator,options) {
|
||||
var results = [];
|
||||
if(operator.prefix === "!") {
|
||||
source(function(tiddler,title) {
|
||||
if(title.substr(0,operator.operand.length).toLowerCase() !== operator.operand.toLowerCase()) {
|
||||
if(title.substr(0,operator.operand.length) !== operator.operand) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
|
||||
if(title.substr(0,operator.operand.length) === operator.operand) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
|
@ -18,7 +18,7 @@ Export our filter function
|
||||
exports.removeprefix = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
if(title.substr(0,operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
|
||||
if(title.substr(0,operator.operand.length) === operator.operand) {
|
||||
results.push(title.substr(operator.operand.length));
|
||||
}
|
||||
});
|
||||
|
@ -18,7 +18,7 @@ Export our filter function
|
||||
exports.removesuffix = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
if(title.substr(-operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
|
||||
if(title.substr(-operator.operand.length) === operator.operand) {
|
||||
results.push(title.substr(0,title.length - operator.operand.length));
|
||||
}
|
||||
});
|
||||
|
@ -19,13 +19,13 @@ exports.suffix = function(source,operator,options) {
|
||||
var results = [];
|
||||
if(operator.prefix === "!") {
|
||||
source(function(tiddler,title) {
|
||||
if(title.substr(-operator.operand.length).toLowerCase() !== operator.operand.toLowerCase()) {
|
||||
if(title.substr(-operator.operand.length) !== operator.operand) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
source(function(tiddler,title) {
|
||||
if(title.substr(-operator.operand.length).toLowerCase() === operator.operand.toLowerCase()) {
|
||||
if(title.substr(-operator.operand.length) === operator.operand) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user