diff --git a/core/modules/widgets/importvariables.js b/core/modules/widgets/importvariables.js index aafc8ba8b..a8bb483b6 100644 --- a/core/modules/widgets/importvariables.js +++ b/core/modules/widgets/importvariables.js @@ -49,7 +49,7 @@ ImportVariablesWidget.prototype.execute = function(tiddlerList) { this.tiddlerList = tiddlerList || this.wiki.filterTiddlers(this.filter,this); // Accumulate the <$set> widgets from each tiddler $tw.utils.each(this.tiddlerList,function(title) { - var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true}); + var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:true}); if(parser) { var parseTreeNode = parser.tree[0]; while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) { diff --git a/editions/test/tiddlers/tests/data/importvariables/WithSetWidgets2.tid b/editions/test/tiddlers/tests/data/importvariables/WithSetWidgets2.tid new file mode 100644 index 000000000..23fa58c57 --- /dev/null +++ b/editions/test/tiddlers/tests/data/importvariables/WithSetWidgets2.tid @@ -0,0 +1,22 @@ +title: ImportVariables/WithSetWidgets2 +description: Import variables defined with a set widget without whitespace pragma +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\whitespace trim +\import Definitions +<$text text=<>/>, +<$text text=<>/> ++ +title: Definitions + +<$set name="one" value="elephant"> +<$set name="two" value="giraffe"> + + ++ +title: ExpectedResult + +

elephant,giraffe

\ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/importvariables/WithSetWidgetsAndMacros.tid b/editions/test/tiddlers/tests/data/importvariables/WithSetWidgetsAndMacros.tid new file mode 100644 index 000000000..eaa81f38c --- /dev/null +++ b/editions/test/tiddlers/tests/data/importvariables/WithSetWidgetsAndMacros.tid @@ -0,0 +1,29 @@ +title: ImportVariables/WithSetWidgetsAndMacros +description: Import variables defined with a set widget without whitespace pragma +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\whitespace trim +\import Definitions +<$text text=<>/>, +<$text text=<
>/>, +<$text text=<>/>, +<$text text=<>/> ++ +title: Definitions + +\define name() Bugs Bunny +\procedure address() +Bunny Hill +\end + +<$set name="one" value="elephant"> +<$set name="two" value="giraffe"> + + ++ +title: ExpectedResult + +

Bugs Bunny,Bunny Hill,elephant,giraffe

\ No newline at end of file