kebab-case (slug) the-kind-of-file-format-with-hyphens

9 views
Skip to first unread message

Lionel BOUHNIK

unread,
Aug 18, 2023, 11:52:26 AM8/18/23
to TextSoap
Hi,
I'm new to TextSoap and I'm surprised I couldn't easily find a way to format a string to kebab-case such as This is what I want to transform to this-is-what-i-want-to-transform (named as slugify in PopClip tool).
Have I looked in the wrong place?
Do I have to make my own converter within TextSoap ?

Thank you.
Cheers.

Mark Munz

unread,
Aug 18, 2023, 11:56:44 AM8/18/23
to text...@googlegroups.com
I can look at adding this as default, but it is fairly easy to create your own custom cleaner to do this:
image.png


--
You received this message because you are subscribed to the Google Groups "TextSoap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to textsoap+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/textsoap/41690286-28c2-40d0-88d3-a18de4dfccd2n%40googlegroups.com.


--
Mark Munz
unmarked software
https://textsoap.com/

Mark Munz

unread,
Aug 18, 2023, 12:53:25 PM8/18/23
to text...@googlegroups.com
I looked up the description of Slugify on PopClips extension and saw there was more involved, so here are the actions that accomplish everything described.

image.png
1. Make everything lowercase
2. Match anything that is NOT a letter, a digit, or whitespace
3. Finally, find any whitespace and replace it with a hyphen
We find one or more, so it only leaves a single hyphen, no matter how many spaces (or tabs) there were before

Reply all
Reply to author
Forward
0 new messages