On Sunday, August 15, 2021 at 7:10:39 AM UTC-7 Misterel85 wrote:
> I first thought there would have been a more straightforward solution to
> that issue, but actually I come to think that it should be possible to
> inspect the first character in the contents of field 2:
> If value of field2 starts with space, then insert ` ` between the
> transclusions, else just proceed with both transclusions.
>
Try this:
<$transclude field="field1"/><$text text={{{
[{!!field2}split[]first[]match[ ]] }}}/><$transclude field="field2"/>
Notes:
* The {{{ [...] }}} is a "filtered transclusion"
* The filter starts by getting the value of the desired field, using
{!!field2}
* It then splits that value into separate characters, using split[]
* Next, it gets just the first character, using first[]
* and compares it with a space, using match[ ]
* The result of the filter is either nothing, or an actual space character
(not an )
* The <$text> widget then converts the output to plain text (instead of
displaying a link to a space!)
enjoy,
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/1830e36e-4dec-4226-9950-f2481bc31876n%40googlegroups.com.