mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Fix detection of empty transclusions
See https://talk.tiddlywiki.org/t/exploring-default-tiddler-links-hackability-in-v5-3-0/5745/25?u=jeremyruston
This commit is contained in:
parent
7a4a8bd3f6
commit
a45349cc99
@ -142,7 +142,7 @@ TranscludeWidget.prototype.collectSlotFillParameters = function() {
|
|||||||
if(node.type === "fill") {
|
if(node.type === "fill") {
|
||||||
if(node.attributes["$name"] && node.attributes["$name"].type === "string") {
|
if(node.attributes["$name"] && node.attributes["$name"].type === "string") {
|
||||||
var slotValueName = node.attributes["$name"].value;
|
var slotValueName = node.attributes["$name"].value;
|
||||||
self.slotFillParseTrees[slotValueName] = node.children;
|
self.slotFillParseTrees[slotValueName] = node.children || [];
|
||||||
}
|
}
|
||||||
noFillWidgetsFound = false;
|
noFillWidgetsFound = false;
|
||||||
} else {
|
} else {
|
||||||
@ -349,7 +349,7 @@ TranscludeWidget.prototype.getTransclusionMetaParameters = function() {
|
|||||||
Fetch the value of a slot
|
Fetch the value of a slot
|
||||||
*/
|
*/
|
||||||
TranscludeWidget.prototype.getTransclusionSlotFill = function(name,defaultParseTreeNodes) {
|
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];
|
return this.slotFillParseTrees[name];
|
||||||
} else {
|
} else {
|
||||||
return defaultParseTreeNodes || [];
|
return defaultParseTreeNodes || [];
|
||||||
|
Loading…
Reference in New Issue
Block a user