mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-02 12:19:11 +00:00
parent
01fa82fac1
commit
8b3bfa6805
@ -17,13 +17,14 @@ Export our filter function
|
|||||||
*/
|
*/
|
||||||
exports.field = function(source,operator,options) {
|
exports.field = function(source,operator,options) {
|
||||||
var results = [],
|
var results = [],
|
||||||
fieldname = (operator.suffix || operator.operator).toLowerCase();
|
fieldname = (operator.suffix || operator.operator).toLowerCase(),
|
||||||
|
isTitle = fieldname === "title";
|
||||||
// Function to check an individual title
|
// Function to check an individual title
|
||||||
function checkTiddler(title) {
|
function checkTiddler(title) {
|
||||||
var tiddler = options.wiki.getTiddler(title);
|
var tiddler = options.wiki.getTiddler(title),
|
||||||
if(tiddler) {
|
text = tiddler ? tiddler.getFieldString(fieldname) : (isTitle ? title : null),
|
||||||
var match,
|
match;
|
||||||
text = tiddler.getFieldString(fieldname);
|
if(text !== null) {
|
||||||
if(operator.regexp) {
|
if(operator.regexp) {
|
||||||
match = !!operator.regexp.exec(text);
|
match = !!operator.regexp.exec(text);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user