kopia lustrzana https://github.com/miklobit/TiddlyWiki5
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.print-window-tiddler
rodzic
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;
|
||||
|
|
Ładowanie…
Reference in New Issue