Import variables should not parse with whitespace trim

Fixes #7909
This commit is contained in:
Jeremy Ruston 2024-03-10 15:03:52 +00:00
parent 00bd6f8ee8
commit 967e2b7fef
5 changed files with 58 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, configTrimWhiteSpace:true});
var parser = widgetPointer.wiki.parseTiddler(title,{parseAsInline:true, configTrimWhiteSpace:false});
if(parser) {
var parseTreeNode = parser.tree[0];
while(parseTreeNode && ["setvariable","set","parameters"].indexOf(parseTreeNode.type) !== -1) {

View File

@ -12,6 +12,7 @@ title: Output
+
title: Definitions
\whitespace trim
<$set name="one" value="elephant">
<$set name="two" value="giraffe">
</$set>

View File

@ -14,6 +14,7 @@ title: Output
+
title: Definitions
\whitespace trim
\define name() Bugs Bunny
\procedure address()
Bunny Hill

View File

@ -0,0 +1,25 @@
title: Transclude/Procedures/Whitespace2
description: Procedures should inherit whitespace settings from definition site
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\procedure testproc()
This is a sentence
\end
\define testmacro()
This is a sentence
\end
This is a sentence
[<<testproc>>]
[<<testmacro>>]
+
title: ExpectedResult
<p>This is a sentence
[This is a sentence ]
[This is a sentence ]
</p>

View File

@ -0,0 +1,30 @@
title: Transclude/Procedures/Whitespace3
description: Procedures should inherit whitespace settings from definition site
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\import Definitions
This is a sentence
[<<testproc>>]
[<<testmacro>>]
+
title: Definitions
\procedure testproc()
This is a sentence
\end
\define testmacro()
This is a sentence
\end
+
title: ExpectedResult
<p>This is a sentence
[This is a sentence ]
[This is a sentence ]
</p>