Traewelling / traewelling

Free check-in service to log your public transit journeys
https://traewelling.de
GNU Affero General Public License v3.0
224 stars 43 forks source link

Links in status messages not clickable but coincidentally contained Träwelling usernames clickable #2661

Open pascalwittler opened 1 month ago

pascalwittler commented 1 month ago

Describe the bug

After posting a status message with a link to one of my own Mastodon posts [1], I noticed that the link was not clickable. My Mastodon username contained in the link is the same as my Träwelling username – and it turns out to be clickable with my Träwelling profile as the link target.

My expectation would be that text parts of status messages that can be parsed as valid URLs would be rendered as clickable links and they would be evaluated with higher priority than substrings.

[1] My status message including my clickable username and the unclickable link

1

Steps to reproduce

  1. Create a status message in your check-in
  2. Insert a URL containing a valid Träwelling username

Browser console logs

No response

Browser

No response

MrKrisKrisu commented 1 month ago

I'm not sure if I would really call that a “bug”. I wouldn't link external links.

However, the internal mention could perhaps be limited to the extent that it is only a mention if there are no other characters before or after.

pascalwittler commented 1 month ago

I definitely see your point.

Only evaluating a mention without non-space characters before and after it could lead in false negatives, for example in comma separated lists (as in „On the way to event XY with @user1, @user2 and @user3“).

Feel free to remove the „bug“ label. It was added automatically after I had to choose between creating an issue or a discussion by the forced templates.