mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Fix #6721
This commit is contained in:
parent
3e33d309ed
commit
b216579255
@ -50,7 +50,7 @@ exports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {
|
||||
if(tr.field) {
|
||||
var tiddler = this.getTiddler(title);
|
||||
if(tr.field === "title") { // Special case so we can return the title of a non-existent tiddler
|
||||
return title;
|
||||
return title || defaultText;
|
||||
} else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
|
||||
return tiddler.getFieldString(tr.field);
|
||||
} else {
|
||||
|
@ -621,6 +621,8 @@ Tests the filtering mechanism.
|
||||
});
|
||||
|
||||
it("should handle indirect operands", function() {
|
||||
expect(wiki.filterTiddlers("[{!!missing}]").join(",")).toBe("");
|
||||
expect(wiki.filterTiddlers("[{!!title}]").join(",")).toBe("");
|
||||
expect(wiki.filterTiddlers("[prefix{Tiddler8}] +[sort[title]]").join(",")).toBe("Tiddler Three,TiddlerOne");
|
||||
expect(wiki.filterTiddlers("[modifier{Tiddler8!!test-field}] +[sort[title]]").join(",")).toBe("TiddlerOne");
|
||||
var fakeWidget = {wiki: wiki, getVariable: function(name) {return name === "currentTiddler" ? "Tiddler Three": undefined;}};
|
||||
|
Loading…
Reference in New Issue
Block a user