Toot

Written by Jonathan Kamens on 2025-01-21 at 03:00

And here's the one line of code I had to add to my filter to fix the problem (preceded by a five-line comment explaining what it's for and why it works):

1 while ($value =~ s/\n([^ \t])/\n $1/g);

Yes, it's written in #Perl. I still write stuff in Perl when it's the right tool for the job. Simple tasks that revolve around text processing are more easily done in Perl than any other language, IMO.

A 🏆 to the first person who can explain why the fix is a loop instead of a single search/replace.

=> More informations about this toot | View the thread | More toots from jik@federate.social

Mentions

Tags

=> View perl tag

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113864110293995914
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
198.446553 milliseconds
Gemini-to-HTML Time
0.324895 milliseconds

This content has been proxied by September (ba2dc).