Widget to trigger hard line breaks?

It’s possible to type """ around a block of wikitext to insert a <br> at the end of each hard line break in the source: https://tiddlywiki.com/#Hard%20Linebreaks%20in%20WikiText

I’d like to create a widget that (among other things) applies such formatting to its contents, but I can’t find any documentation on any non-wikitext way to do this. I can’t even use $wikify or a filter, since one cannot (as far as I know) pass the contents of a slot into a widget attribute or filter.

Is there any way to achieve this, aside from writing a JavaScript widget?

Perhaps use preview to see the raw html generated on tiddlywik.com when using """ and use the htmltag rather than widget.

In some ways this leaves the linebreaks rather than remove them, the result of parsing.

If developing a custom widget make sure you insert an empty line to trigger block mode.

I can help more when I return to my desktop later today.

I did create a plugin space-space-newline, which uses the same spec as commonmark the new markdown specification.

If you place 2 spaces in front of a line-break it inserts a hard linebreak.

The plugin implements a new wikitext parse-rule.

See: Space Space Newline — creates a hard linebreak

1 Like