Trim whitespace when importing variables in $importvariables (#7611)

* fix: trim whitespace when importing variables

* feat: added tests for importing variables
This commit is contained in:
Saq Imtiaz
2023-07-17 10:18:42 +02:00
committed by GitHub
parent b54a88ce83
commit 284669544b
3 changed files with 52 additions and 1 deletions

View File

@@ -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) {