this post was submitted on 19 Jun 2025
33 points (97.1% liked)

Voyager

6792 readers
10 users here now

The official lemmy community for Voyager, an open source, mobile-first client for lemmy.

Download on App Store

Download on Play Store

Use as a Web App

Download on F-Droid

Rules

  1. Be nice.
  2. lemmy.world instance policy

Sponsor development! ๐Ÿ‘‡

Number of sponsors badge

๐Ÿ’™

founded 2 years ago
MODERATORS
 

So if its just a URL without the []() syntax it would be, perhaps green, and links with it could stay blue. Good semantic to avoid spam or malware links.

Anyway, have any of you seen today's XKCD? https://xkcd.com/3104

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 2 points 1 day ago (4 children)

^https?://[a-zA-Z0-9\.-]+(/[^\s]*)?$

Been a while since I've written regex and it could certainly be a little bit more correct. But whatever Voyager already uses to find URLs in a text to turn into a link should suffice.

[โ€“] [email protected] 2 points 1 day ago* (last edited 1 day ago) (3 children)

Okay, now what if I put in an invisible Unicode character in there?

[โ€“] [email protected] 2 points 1 day ago (2 children)

For that you strip the string to be tested of all non-ASCII chars before you run the regex.

But I see what you mean. I just fear that if links could be shown in different equally non-threatening colors users wouldn't know what to do with that information.

[โ€“] [email protected] 2 points 1 day ago* (last edited 1 day ago) (1 children)

Okay, what if I use unicode characters that look similar to httั€ั•://ั…kัd.ัะพm/ and the function sees that an empty string is not a URL.

[โ€“] [email protected] 2 points 17 hours ago

Yeah, I think the link preview is the only real solution. Like you said, best shown under the same paragraph.