Inserting a carriage return into tiddler text via filters

I am trying to use the following to create a bulleted list from the three statements

* Object type: <$view field="object_type" /><p><p>* Date start: <$view field="date_start" /><p><p>* Date end: <$view field="date_end" /><p>{{CS22}}

This does not work, as shown in the image

I have tried single <p> as well as <br> but nothing seems to work. How do I add a carriage return/linefeed character so the bulleted list is correctly rendered?

bobj

Why the <p> then unclosed <p> ?

* Object type: <$view field="object_type" />
* Date start: <$view field="date_start" />
* Date end: <$view field="date_end" />{{CS22}}
This does not work, as shown in the image

Not if html or a widget proceeds the above you may need a blank line above

Typically when I generate lists where the automatic bullet formatting doesn’t work (because the items are listed inline), I just do this instead

<$list filter='...'> &nbsp; • foobar<br></$list>

i.e use a bullet character and a break at end.

Hi @Bob_Jansen,

Elaborating on Eric’s answer here, for this use case you should not try to insert html tags like <p> or <br> for linebreaks but only simple wikitext. I suggest you try this:

text={{{
   [[* Object type: ]] [{$:/TLS/object_type}] [charcode[10]]
   [[* Date Start: ]] [{$:/TLS/date_start}] [charcode[10]]
   [[* Date end: ]] [{$:/TLS/date_end}] [charcode[10]]
   [charcode[10]]
   [{$:/TLS/incremental}addprefix[CS]addprefix[{{]addsuffix[}}]]
   +[join[]]
   }}}

What I did here is:

  • Add a * at the beginning of each line
  • Add a linebreak character at the end of each line ([charcode[10]])
  • Remove html tags which are not needed because what you want in the text field is wikitext, not html.

The result is a text string containing wikitext to be rendered in your new tiddler.

Have fun!

Fred

1 Like

A slight correction to @tw-FRed’s response…

By default, filter syntax applies “dominant append” handling to prevent duplicates from appearing in the resulting list of items. Thus, if a filter were defined as:

Foo Bar Baz Foo Gronk Snork Baz Foo Snerkle

the list that actually results would be:

Bar Gronk Snork Baz Foo Snerkle

i.e., only the last occurence of each repeated item – “Foo” and “Baz” – would be retained in the list.

Thus, in @tw-FRed’s response, only the last instance of the [charcode[10]] filter run will be retained in the final result. To bypass this “dominant append” handling and allow multiple instances of the same value to be retained, you need to precede each duplicated “line break” filter run with a “=”, like this:

text={{{
   [[* Object type: ]] [{$:/TLS/object_type}] =[charcode[10]]
   [[* Date Start: ]] [{$:/TLS/date_start}] =[charcode[10]]
   [[* Date end: ]] [{$:/TLS/date_end}] =[charcode[10]]
   =[charcode[10]]
   [{$:/TLS/incremental}addprefix[CS]addprefix[{{]addsuffix[}}]]
   +[join[]]
   }}}

Thanks for the fix Eric, I always forget about this…

Have fun!

Fred

Thanks @tw-FRed and EricShulman, your suggestion worked a treat.

bobj