Copying a link includes the click count


(Yaw Anokwa) #1

Sometimes I have text with a URL that folks have clicked on, say 9 times.

Lorem ipsum dolor sit amet https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc onsetetur sadipscing elitr.

Someone copies that text and pastes it into another post. They don’t notice the 9 at the end. So we now have a link that looks valid, but isn’t.

Lorem ipsum dolor sit amet https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc9 onsetetur sadipscing elitr.

This happens because we have a group of people who take turns writing community announcements that always have a link to a running Google Doc. Person B copies the previous announcement from Person A and then yeah, broken links everywhere. Could there be a space added before the click count?


(Jeff Atwood) #2

I believe that’d be a markup issue @awesomerobot I do like the suggestion if we can do it easily, have seen this before.


(Sam Saffron) #3

It’s possible we could have a space here inserted, but even copying the number is superfluous imo, it should be in <span class='ignore-copy'> or something like that and we should get it into the clipboard without the number.

Also @yanokwa do you have enable rich text paste enabled, does this resolve your issue?

@vinothkannans we got to spend some time improving internal usage of enable rich text paste, it is a bit flakey.


(Kris) #4

There’s a way to do prevent copying using psuedo elements, but it’s not great for accessibility (“CSS generated content is not content”)

Adding a space is a small improvement that shouldn’t impact anything else though.


(Jeff Atwood) #5

This is always :musical_note: to my :ear:s


(Yaw Anokwa) #6

I do not rich text paste enabled and when I tried, it did not resolve the issue.


(Kris) #7

PR to add a space before the counter here:


(Kris) #8

Space is added, so now you can copy & paste without breaking the link… like so:

https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc 2

Still room for future improvement, like not allowing click counts into the clipboard at all.


(Jeff Atwood) #9

Confirmed looks good, results in:

dolor sit amet https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc 2 onsetetur

Great idea @yanokwa