this post was submitted on 19 Jun 2025
35 points (97.3% liked)

Voyager

6941 readers
62 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

top 13 comments
sorted by: hot top controversial new old
[–] bjoern_tantau@swg-empire.de 4 points 2 weeks ago

Well played sir, well played.

[–] aeharding@vger.social 3 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

The link preview stuff in comments solves that problem. It’s not in posts though similar to apollo, only comments. It could be added to posts, maybe as a preference.

Edit: another idea is a pop to confirm location on click if URL-like label doesn’t match domain of actual url.

[–] LodeMike@lemmy.today 2 points 2 weeks ago

It'd also be nice if the link preview had a setting to put it under the paragraph with the link instead of at the bottom. A bit unweildy for some longer posts/comments.

[–] LodeMike@lemmy.today 2 points 2 weeks ago

I like the idea in the edit more honestly. My only concern is that detecting a URL in the text part might be hard. Especially with a malicious user there could be invisible Unicode characters.

[–] bjoern_tantau@swg-empire.de 2 points 2 weeks ago (1 children)

I thought a bit more about it and I think instead of colouring URLs differently a better approach might be to colour []() in red if the label looks like a URL but is different from the actual URL.

[–] LodeMike@lemmy.today 2 points 2 weeks ago (1 children)

What does "look like a URL" entail.

[–] bjoern_tantau@swg-empire.de 2 points 2 weeks ago (1 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.

[–] LodeMike@lemmy.today 2 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

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

[–] bjoern_tantau@swg-empire.de 2 points 2 weeks ago (1 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.

[–] LodeMike@lemmy.today 2 points 2 weeks ago* (last edited 2 weeks 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.

[–] bjoern_tantau@swg-empire.de 2 points 2 weeks ago

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

[–] nimble@lemmy.blahaj.zone 2 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

I do like at the bottom of comments the links are listed and where they go to. But that doesn't look like that happened here with your post's link?

https://example.com/

Edit: also for accessibility it's best to not exclusively convey information through color.

[–] LodeMike@lemmy.today 1 points 2 weeks ago* (last edited 2 weeks ago)

Oh right accessability. Hmm. Maybe bolded? That's also hackable by the markdown though.