REQUEST - We need a suffix line param to work with the prefix param

57 views
Skip to first unread message

David Gifford

unread,
May 12, 2020, 9:22:04 PM5/12/20
to TiddlyWiki
In this thread, Anne-Laure Le Cunff requested a way to format paragraphs when importing from other programs.

The ideal would be an editortoolbar button that prefixes each line with <p>* and suffixes each line with </p>

I discovered that you can prefix lines okay (eg bulleted lists), but you can't suffix lists. The wrap-lines param only wraps the entire selection, not each individual line.

Would there be a way to create a new param and a button that does both actions together?

TonyM

unread,
May 12, 2020, 10:07:18 PM5/12/20
to TiddlyWiki
David,

I believe this is already possible. Let me check, but also see my new solution https://groups.google.com/forum/?hl=en#!topic/tiddlywiki/tXYXdvk3VXI

Regards
Tony

Mark S.

unread,
May 12, 2020, 11:12:47 PM5/12/20
to TiddlyWiki
It kind of seems like "wrap-lines" is broken. Otherwise, what is the difference between it and "wrap-selection" ?

TonyM

unread,
May 12, 2020, 11:29:04 PM5/12/20
to TiddlyWiki
David/Mark,

It seems broken as Mark says, but I though there was a fix, or a workaround I cant find.

As you know the editor toolbar button for bullets prefixes each line
The following is in $:/core/ui/EditorToolbar/list-bullet
<$action-sendmessage
 $message="tm-edit-text-operation"
 $param="prefix-lines"
 character="*"
 count="1"
/>

And others like the monospace 

$:/core/ui/EditorToolbar/mono-block

<$action-sendmessage
 $message="tm-edit-text-operation"
 $param="wrap-lines"
 prefix="
```"
 suffix="```"
/>

The above are using the message tm-edit-text-operation

Now here is the rub, I was confident there is away to implement prefix and suffix on each line, perhaps in a pre-release? Perhaps a hack or is it a false memory?

  • You can add more than one action in an editor toolbar button, but I can't see the missing function you mention.
  • A line suffix is replacing newline with something newline
I am currently playing with [all[current]get[text]splitregexp[\n]] for an answer.

Regards
Tony

PMario

unread,
May 14, 2020, 2:11:47 PM5/14/20
to TiddlyWiki
On Wednesday, May 13, 2020 at 3:22:04 AM UTC+2, David Gifford wrote:
In this thread, Anne-Laure Le Cunff requested a way to format paragraphs when importing from other programs.

The ideal would be an editortoolbar button that prefixes each line with <p>* and suffixes each line with </p>

hmmm,

If you are able to position the cursor in the right position and hit a button, IMO it would be easier to position the cursor and hit the [Enter] key 2 times.
Done.

Just a thought.
-m

Mark S.

unread,
May 14, 2020, 2:46:12 PM5/14/20
to TiddlyWiki

Not getting this. Imagine you have dozens of long lines. If you have to format them to human-readable text, you'd like to do it in a single step.

Besides, shouldn't "wrap-lines" do something different than "wrap-selection" ??
Reply all
Reply to author
Forward
0 new messages