From a45349cc996390192114fed486bfa6900da641d7 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Wed, 11 Jan 2023 08:57:54 +0000 Subject: [PATCH] Fix detection of empty transclusions See https://talk.tiddlywiki.org/t/exploring-default-tiddler-links-hackability-in-v5-3-0/5745/25?u=jeremyruston --- core/modules/widgets/transclude.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index bb73a9dd9..d4f8e9e45 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -142,7 +142,7 @@ TranscludeWidget.prototype.collectSlotFillParameters = function() { if(node.type === "fill") { if(node.attributes["$name"] && node.attributes["$name"].type === "string") { var slotValueName = node.attributes["$name"].value; - self.slotFillParseTrees[slotValueName] = node.children; + self.slotFillParseTrees[slotValueName] = node.children || []; } noFillWidgetsFound = false; } else { @@ -349,7 +349,7 @@ TranscludeWidget.prototype.getTransclusionMetaParameters = function() { Fetch the value of a slot */ TranscludeWidget.prototype.getTransclusionSlotFill = function(name,defaultParseTreeNodes) { - if(name && this.slotFillParseTrees[name]) { + if(name && this.slotFillParseTrees[name] && this.slotFillParseTrees[name].length > 0) { return this.slotFillParseTrees[name]; } else { return defaultParseTreeNodes || [];