mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 12:07:19 +00:00
Special treatment so that text reference to title field works for missing tiddlers
The title field is the one field that we know for missing tiddlers. This is needed in a subsequent commit of viewswitcher.
This commit is contained in:
parent
53ead15273
commit
1304bfd0d4
@ -36,7 +36,9 @@ exports.getTextReference = function(textRef,defaultText,currTiddlerTitle) {
|
||||
title = tr.title || currTiddlerTitle;
|
||||
if(tr.field) {
|
||||
var tiddler = this.getTiddler(title);
|
||||
if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
|
||||
if(tr.field === "title") { // Special case so we can return the title of a non-existent tiddler
|
||||
return title;
|
||||
} else if(tiddler && $tw.utils.hop(tiddler.fields,tr.field)) {
|
||||
return tiddler.getFieldString(tr.field);
|
||||
} else {
|
||||
return defaultText;
|
||||
|
Loading…
Reference in New Issue
Block a user