I just noticed earlier white typing a message here.
- Select a link with/out following text (the selection must start with a link)
- Try moving it in another place
- Result: Most of the link is gone.
I just noticed earlier white typing a message here.
What browser is this on? Does this repro on all browsers?
I’m sorry! I should have tested on other browsers. Context is always important in a bug report; I will be careful next time.
It was on Chrome (no extension loaded)
A quick test on Firefox, it doesn’t happen.
Other browsers, such as Edge, Brave, Opera, Arc - it does happen. They are all chromium-based, though.
I can’t test on Safari right now.
Have you tried in a TEXTAREA that is not in Discourse?
Oh, that’s interesting.
At first, I tried GitHub to comment on a random PR, but it didn’t happen.
Then, I create a basic HTML file with only a TEXTAREA and it does happen.
So, I guess there is natively an issue with chromium ; I did search a little but could not find anything yet. I will see tomorrow if I can figure out more details.
I investigated a little more. (ahah, I forgot I started draft one month ago)
This is a very old bug reported in 2016 and still present in the latest version:
https://issues.chromium.org/issues/41247238
Basically, it would seem that selected text containing a colon (not the first character) is considered a URL by Chromium, and the left part is normalized/removed. However, in the case of a valid URL, it seems to remove the left part before the last “/” character (I could not find an issue specifically for that).
Possibly related source code:
Here is a demo in basic textarea:
Anyway, we can close it. Chromium does crazy things.