diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index 734e17f25..4d40cadcc 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -171,7 +171,13 @@ TranscludeWidget.prototype.getTransclusionTarget = function() { if(this.transcludeVariable) { var variableInfo = this.getVariableInfo(this.transcludeVariable).srcVariable; if(variableInfo) { - parser = this.wiki.parseText(this.transcludeType,variableInfo.value || "",{parseAsInline: !this.parseTreeNode.isBlock}); + var mode = this.parseTreeNode.isBlock ? "blockParser" : "inlineParser"; + if(variableInfo[mode]) { + parser = variableInfo[mode]; + } else { + parser = this.wiki.parseText(this.transcludeType,variableInfo.value || "",{parseAsInline: !this.parseTreeNode.isBlock}); + variableInfo[mode] = parser; + } if(parser && variableInfo.isFunctionDefinition) { parser = { tree: [ diff --git a/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid index 9cc318b12..74ecb575d 100644 --- a/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid +++ b/editions/test/tiddlers/tests/data/transclude/CustomWidget-Simple.tid @@ -23,7 +23,10 @@ title: TiddlerOne <$mywidget one="Dingo"> Crocodile +<$mywidget one="BumbleBee"> + Squirrel + + title: ExpectedResult -

DingoCrocodile

\ No newline at end of file +

DingoCrocodileBumbleBeeSquirrel

\ No newline at end of file