-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the bug
When assigning an MVV with $let and then using that variable as a procedure parameter, its multi-valued nature is not preserved:
\procedure show-items(itemList)
<h2>itemList</h2>
<$list filter="[(itemList)]" counter="id" join="<br>" >
Item number <<id>> is <<currentTiddler>>
</$list>
<h2>items</h2>
<$list filter="[(items)]" counter="id" join="<br>" >
Item number <<id>> is <<currentTiddler>>
</$list>
\end
<$let items={{{ [tag[Learning]] }}} >
<$transclude $variable="show-items" itemList=<<items>> />
</$let>
This should yield two lists with a large number of items each. However, the first list contains only one item.
A closely related problem is the situation when the items list is empty, since the procedure cannot distinguish between an MVV without any elements and an empty variable.
Within the above procedure, [(items)] will then also be empty, but [(itemList)] or [<itemList>] will be an empty string, so the line
<$list filter="[(itemList)]" counter="id" join="<br>" >
would need to be changed to
<$list filter="[(itemList)!is[blank]" counter="id" join="<br>" >
to mostly function the same. However, that will interfere with situations where one of the items can actually be blank (for testing use <$let items={{{ [[]] [tag[Learning]] }}} >).
Expected behavior
MVVs should keep all their properties when used in procedures (and functions).
To Reproduce
Use the above examples on https://tiddlywiki.com/prerelease/
Screenshots
No response
TiddlyWiki Configuration
- Version 5.4.0-prerelease
Additional context
No response