1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-04-26 16:51:30 +00:00

Empty or missing type on genesis widget should not render an element/widget

Fixes #7153
This commit is contained in:
jeremy@jermolene.com
2022-12-30 21:42:07 +00:00
parent bf8e1ca5b0
commit 42a408146d
3 changed files with 23 additions and 2 deletions

View File

@@ -42,10 +42,15 @@ Compute the internal state of the widget
GenesisWidget.prototype.execute = function() {
var self = this;
// Collect attributes
this.genesisType = this.getAttribute("$type","element");
this.genesisType = this.getAttribute("$type");
this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes";
this.genesisNames = this.getAttribute("$names","");
this.genesisValues = this.getAttribute("$values","");
// Do not create a child widget if the $type attribute is missing or blank
if(!this.genesisType) {
this.makeChildWidgets(this.parseTreeNode.children);
return;
}
// Construct parse tree
var isElementWidget = this.genesisType.charAt(0) !== "$",
nodeType = isElementWidget ? "element" : this.genesisType.substr(1),