diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index adf83a9f8..1086bd5eb 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -509,16 +509,10 @@ Widget.prototype.makeChildWidget = function(parseTreeNode,options) { if(!parseTreeNode.isNotRemappable && isOverrideable() && variableInfo && variableInfo.srcVariable && variableInfo.srcVariable.value && variableInfo.srcVariable.isWidgetDefinition) { var newParseTreeNode = { type: "transclude", - children: [ - { - type: "fill", - children: parseTreeNode.children - } - ], + children: parseTreeNode.children, isBlock: parseTreeNode.isBlock }; $tw.utils.addAttributeToParseTreeNode(newParseTreeNode,"$variable",variableDefinitionName); - $tw.utils.addAttributeToParseTreeNode(newParseTreeNode.children[0],"$name","ts-body"); $tw.utils.each(parseTreeNode.attributes,function(attr,name) { // If the attribute starts with a dollar then add an extra dollar so that it doesn't clash with the $xxx attributes of transclude name = name.charAt(0) === "$" ? "$" + name : name; diff --git a/editions/test/tiddlers/tests/data/genesis-widget/RedefineLet.tid b/editions/test/tiddlers/tests/data/genesis-widget/RedefineLet.tid index 99bf18e24..184f6014f 100644 --- a/editions/test/tiddlers/tests/data/genesis-widget/RedefineLet.tid +++ b/editions/test/tiddlers/tests/data/genesis-widget/RedefineLet.tid @@ -10,7 +10,7 @@ title: Output \whitespace trim <$parameters $params="@params"> <$setmultiplevariables $names="[<@params>jsonindexes[]]" $values="[<@params>jsonindexes[]] :map[<@params>jsongetaddprefix[--]addsuffix[--]]"> -<$slot $name="ts-body"/> +<$slot $name="ts-raw"/> \end diff --git a/editions/test/tiddlers/tests/data/globals/CustomWidget.tid b/editions/test/tiddlers/tests/data/globals/CustomWidget.tid index 58d345b81..98ee4e5d7 100644 --- a/editions/test/tiddlers/tests/data/globals/CustomWidget.tid +++ b/editions/test/tiddlers/tests/data/globals/CustomWidget.tid @@ -15,7 +15,7 @@ title: $:/global/$$mywidget _is_widget: yes _parameters: (foo:"bar") -Koala! <$text text=<>/>, <$slot $name="ts-body"/> +Koala! <$text text=<>/>, <$slot $name="ts-raw"/> + title: ExpectedResult diff --git a/editions/test/tiddlers/tests/data/transclude/CustomWidget-Fail.tid b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Fail.tid index 15be21b05..3d0759013 100644 --- a/editions/test/tiddlers/tests/data/transclude/CustomWidget-Fail.tid +++ b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Fail.tid @@ -10,7 +10,7 @@ title: Output \widget $non-existent-widget(one:'Jaguar') \whitespace trim <$text text=<>/> -<$slot $name="ts-body"> +<$slot $name="ts-raw"> Whale \end diff --git a/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid index f98b2079a..70fedb61d 100644 --- a/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid +++ b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid @@ -16,7 +16,7 @@ title: TiddlerOne \widget $$mywidget(one:'Jaguar') \whitespace trim <$text text=<>/> -<$slot $name="ts-body"> +<$slot $name="ts-raw"> Whale \end diff --git a/editions/test/tiddlers/tests/data/transclude/CustomWidget-Slotted.tid b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Slotted.tid new file mode 100644 index 000000000..c10e84127 --- /dev/null +++ b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Slotted.tid @@ -0,0 +1,27 @@ +title: Transclude/CustomWidget/Slotted +description: Custom widget definition +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\whitespace trim +\widget $$mywidget(one:'Jaguar') +\whitespace trim +<$text text=<>/> +<$slot $name="ts-stuff"> + Whale + +\end +<$$mywidget one="Dingo"> + <$fill $name="ts-stuff"> + Crocodile + + +<$$mywidget one="BumbleBee"> + Squirrel + ++ +title: ExpectedResult + +

DingoCrocodileBumbleBeeWhale

\ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/transclude/CustomWidget-TextWidgetOverride.tid b/editions/test/tiddlers/tests/data/transclude/CustomWidget-TextWidgetOverride.tid index 0a65533f6..97313fcbd 100644 --- a/editions/test/tiddlers/tests/data/transclude/CustomWidget-TextWidgetOverride.tid +++ b/editions/test/tiddlers/tests/data/transclude/CustomWidget-TextWidgetOverride.tid @@ -17,7 +17,7 @@ title: TiddlerOne \whitespace trim <$genesis $type="text" $remappable="no" text=<>/> <$set name="$text" value=""> - <$slot $name="ts-body"> + <$slot $name="ts-raw"> Whale diff --git a/editions/test/tiddlers/tests/data/transclude/CustomWidget-VariableAttribute.tid b/editions/test/tiddlers/tests/data/transclude/CustomWidget-VariableAttribute.tid index 63fd5f87a..8ef700b41 100644 --- a/editions/test/tiddlers/tests/data/transclude/CustomWidget-VariableAttribute.tid +++ b/editions/test/tiddlers/tests/data/transclude/CustomWidget-VariableAttribute.tid @@ -16,7 +16,7 @@ title: TiddlerOne \widget $$mywidget($variable:'Jaguar') \whitespace trim <$text text=<<$variable>>/> -<$slot $name="ts-body"> +<$slot $name="ts-raw"> Whale \end