1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-13 22:07:15 +00:00

Use default link text when link widget has no content

Fixes #3974
This commit is contained in:
Jeremy Ruston
2019-06-10 21:04:21 +01:00
parent cd412d8ccb
commit f02352f6a1
2 changed files with 14 additions and 3 deletions

View File

@@ -183,7 +183,14 @@ LinkWidget.prototype.execute = function() {
this.isShadow = this.wiki.isShadowTiddler(this.to);
this.hideMissingLinks = (this.getVariable("tv-show-missing-links") || "yes") === "no";
// Make the child widgets
this.makeChildWidgets();
var templateTree;
if(this.parseTreeNode.children && this.parseTreeNode.children.length > 0) {
templateTree = this.parseTreeNode.children;
} else {
// Default template is a link to the title
templateTree = [{type: "text", text: this.to}];
}
this.makeChildWidgets(templateTree);
};
/*