Here's a solution. Hopefully there's a more elegant one. In my data, "test"
is the data tiddler and "idx1" is the index.
This uses the new search-replace operator to replace linefeeds with html
linebreaks, so that the text will display
as expected.
<$vars eol="<br/>" lf="""
""">
<$set name=out value={{{ [[test]getindex[idx1]search-replace:g<lf>,<eol>]
}}} >
<<out>>
</$set>
</$vars>
If you want output like TW, with single linefeeds ignored but double
linefeeds recognized, then you could use the simpler:
<$wikify name=out text="""<$transclude tiddler=test index=idx1 mode=block
/>""" output="html">
<<out>>
</$wikify>
On Wednesday, January 6, 2021 at 1:42:56 AM UTC-8 [email protected]
wrote:
> Hi
>
> Yes, I'm already using block mode. The code looks like this:
>
> <$transclude tiddler="_planning_descriptions" index={{!!created}}
> mode=block/>
>
> (I'm using this tiddler as a template and storing the textbox content in a
> json, indexed by the "created" timecode so that they can be renamed freely)
>
> If I use inline mode, it doesn't respect any linebreaks at all (even
> double ones).
>
> Thanks for your response
>
> On Wednesday, 6 January 2021 at 00:29:15 UTC TW Tones wrote:
>
>> Just a quick check;
>>
>> If you use the transclude widget you can specify mode=block, have you
>> tried this yet?
>>
>> The triple quotes is more a WikiMarkup option for text within a tiddler.
>> With transclusion and templates and more the inline vs block tends to be
>> used. See <https://tiddlywiki.com/#TranscludeWidget>
>>
>> Tones
>>
>> On Wednesday, 6 January 2021 at 01:01:04 UTC+11 [email protected]
>> wrote:
>>
>>> Hi all
>>>
>>> I have some text stored in a json datatiddler which I'm pulling out
>>> using the transclude widget in index mode.
>>>
>>> I'd like to display this text with hard linebreaks respected, rather
>>> than the default tiddlywiki behaviour of ignoring single linebreaks and
>>> collapsing many linebreaks down into one. However I can't seem to do this,
>>> even when wrapping my transclude widget in triple double quotes as
>>> described here
>>> <https://tiddlywiki.com/static/Hard%2520Linebreaks%2520in%2520WikiText.html>
>>> .
>>>
>>> Any advice on how to do this? I suspect its something to do with how the
>>> json encodes text, but its not my area of expertise.
>>>
>>> Thanks a ton
>>>
>>
--
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/e8b4b90b-c82c-41aa-b468-3ed7938687cfn%40googlegroups.com.