diff --git a/core/modules/widgets/genesis.js b/core/modules/widgets/genesis.js index 6d30f3c36..c8403a3d4 100644 --- a/core/modules/widgets/genesis.js +++ b/core/modules/widgets/genesis.js @@ -46,6 +46,7 @@ GenesisWidget.prototype.execute = function() { this.genesisRemappable = this.getAttribute("$remappable","yes") === "yes"; this.genesisNames = this.getAttribute("$names",""); this.genesisValues = this.getAttribute("$values",""); + this.genesisIsBlock = this.getAttribute("$mode",this.parseTreeNode.isBlock && "block") === "block"; // Do not create a child widget if the $type attribute is missing or blank if(!this.genesisType) { this.makeChildWidgets(this.parseTreeNode.children); @@ -60,6 +61,7 @@ GenesisWidget.prototype.execute = function() { tag: nodeTag, attributes: {}, orderedAttributes: [], + isBlock: this.genesisIsBlock, children: this.parseTreeNode.children || [], isNotRemappable: !this.genesisRemappable }]; diff --git a/editions/test/tiddlers/tests/data/genesis-widget/Block.tid b/editions/test/tiddlers/tests/data/genesis-widget/Block.tid new file mode 100644 index 000000000..dfa5dacaf --- /dev/null +++ b/editions/test/tiddlers/tests/data/genesis-widget/Block.tid @@ -0,0 +1,30 @@ +title: Genesis/Block +description: genesis widget distinguishes between block and inline +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\whitespace trim +<$genesis $type="$reveal" type=nomatch> + +Block +$genesis> + +<$genesis $type="$reveal" type=nomatch $mode=block> + +Block forced block +$genesis> + +<$genesis $type="$reveal" type=nomatch $mode=inline> + +Block forced inline +$genesis> + +<$genesis $type=$reveal type=nomatch>Inline$genesis> +<$genesis $type=$reveal type=nomatch $mode=block>Inline forced block$genesis> +<$genesis $type=$reveal type=nomatch $mode=inline>Inline forced inline$genesis> ++ +title: ExpectedResult + +
Block
Block forced block
Block forced inline
Inline