Having lots of fun programming my new TW app and feeling much more confident on the brackets front - a very positive day!
However, have come across one niggling issue - multi-line fields.
I would like my data tiddlers to store multi-line fields and not just in the text area as this is used to display the data in a formatted way. However, if I add a new data tiddler with the multiline field containing
line 1
line 2
line 3
then once stored, we loose the line breaks and the 'formated; display just shows
line 1line 2line 3
I have been searching for a solution and have come across the discussion from 2022 related to multi-line editing but it is old. Is it still valid for the current TW version?
Can someone suggest a solution to my issue?
My code at present is
Exhibition Essay: <$edit-text tiddler="$:/TLS/Exhibition/Essay" tag="textarea" default="" placeholder="the text of any essay/artist statement"/>
-----
<$button>
<$action-createtiddler
$basetitle={{{ [{$:/TLS/Prefix/Exhibition!!exhibition_id}addprefix{$:/TLS/Prefix/Exhibition!!exhibition_prefix}] }}}
exhibition_essay={{$:/TLS/Exhibition/Essay}}
$template="$:/TLS/CreateTemplate/Exhibitions"
/>
Add this item
</button>
The line breaks you enter are actually preserved in the resulting tiddler. However, when you edit that tiddler the exhibition_essay field is displayed using a tag="input" rather than a tag="textarea" so it LOOKS like the line breaks are gone, but they are, in fact, still there… as long as you don’t change the value in that field.
The real problem is displaying the field value with the line breaks intact. By default, HTML rendering does not preserve line breaks and reduces all other whitespace separators to single space characters when displayed.
However, this rendering handling can be controlled by using CSS, like this: