1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Fixed bug with default value in lookup operator (#5088)

* Fixed bug with default value in lookup operator

* Fixed test for lookup operator with default
This commit is contained in:
saqimtiaz 2020-11-22 21:43:36 +01:00 committed by GitHub
parent d2f87d6200
commit 51ca14861e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ Export our filter function
exports.lookup = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
results.push(options.wiki.getTiddlerText(operator.operand + title) || options.wiki.getTiddlerText(operator.operand + operator.suffix));
results.push(options.wiki.getTiddlerText(operator.operand + title) || operator.suffix);
});
return results;
};

View File

@ -207,7 +207,7 @@ function runTests(wiki) {
it("should handle the lookup operator", function() {
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup[Tiddler]]").join(",")).toBe("Missing inaction from TiddlerOne,,Tidd");
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup:8[Tiddler]]").join(",")).toBe("Missing inaction from TiddlerOne,Tidd,Tidd");
expect(wiki.filterTiddlers("Six Seventh 8 +[lookup:8[Tiddler]]").join(",")).toBe("Missing inaction from TiddlerOne,8,Tidd");
});
it("should retrieve shadow tiddlers", function() {