Not a bug, or at least, not a bug with the ts-raw slot. You can actually understand this by substituting each slot with its fill value.
As you know, if you use the ts-raw slot without explicitly filling it, then it gets filled with the contents of the widget call - including the additional $fill widgets that you wrote inside the widget call.
Let’s perform this substitution exercise on each of the slots in your stripped-down minimal example:
Starting with the widget definition:
<$slot $name="ts-raw">Default</$slot>
<$slot $name="extra">Result</$slot>
Let’s first replace the ts-raw slot with what we know fills it (the contents of the widget call), that is,
Bespoke
<$fill $name="extra">Custom</$fill>
Result:
Bespoke
<$fill $name="extra">Custom</$fill>
<$slot $name="extra">Result</$slot>
Now let’s replace the extra
slot with what fills it (Custom
):
Bespoke
<$fill $name="extra">Custom</$fill>
Custom
This is what the widget call actually evaluates to.
And if you copy and paste that into a tiddler, you get:
Bespoke Custom Custom
In fact, if you simply copy and paste <$fill $name="extra">Custom</$fill>
into a separate new tiddler, it displays Custom
. Apparently, the behavior of $fill
widgets that aren’t contained in $transclude or widget calls, is to simply display its contents. (If that is a bug, then the simplest way to reproduce the bug is actually to just paste <$fill $name="extra">Custom</$fill>
into a new tiddler. One could make an argument that this should display nothing, since there is no slot being filled. But because it displays its contents, it has the effect of “duplicating” the other slot, since it is explicitly filled separately.)
I’m sure you know the reason now, but for the sake of completeness: If you remove the ts-raw slot, then you’re not copying the $fill widget into the ts-raw slot, so you only see the Custom
from the extra
slot. Likewise, if you explicitly fill the ts-raw slot, then it is filled only with whatever you fill it with, but not with the whole contents of the widget call including the $fill widgets.