# Copying a link includes the click count

**URL:** https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531
**Category:** Feature
**Tags:** completed, click-counter
**Created:** [March 22, 2018, 3:34am UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531 "2018-03-22T03:34:33Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![yanokwa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yanokwa/32/105083_2.png) [@yanokwa](https://meta.discourse.org/u/yanokwa)
#### Post date: [March 22, 2018, 3:34am UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/1 "2018-03-22T03:34:33Z")

</div>

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

> Lorem ipsum dolor sit amet [https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc](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](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?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 22, 2018, 3:56am UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/2 "2018-03-22T03:56:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [March 22, 2018, 4:18am UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/3 "2018-03-22T04:18:53Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [March 22, 2018, 4:27am UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/4 "2018-03-22T04:27:25Z")

</div>

There’s a way to do prevent copying using psuedo elements, but it’s not great for accessibility (“[CSS generated content is not content](http://www.karlgroves.com/2013/08/26/css-generated-content-is-not-content/)”)

> **[Prevent an element from being selected and copied with CSS — Daniel O’Connor](https://danoc.me/blog/css-prevent-copy)**
>
> How to use pseudo-elements, data attributes, and CSS's content property to prevent text from being selected and copied.

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 22, 2018, 4:52am UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/5 "2018-03-22T04:52:22Z")

</div>

> [@awesomerobot](#):
>
> a small improvement that shouldn’t impact anything else though.

This is always 🎵 to my 👂s

---

<div class="post-metadata">

### Author: ![yanokwa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yanokwa/32/105083_2.png) [@yanokwa](https://meta.discourse.org/u/yanokwa)
#### Post date: [March 22, 2018, 4:42pm UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/6 "2018-03-22T16:42:52Z")

</div>

> [@sam](#):
>
> Also @yanokwa do you have enable rich text paste enabled, does this resolve your issue?

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

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [March 22, 2018, 5:27pm UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/7 "2018-03-22T17:27:33Z")

</div>

PR to add a space before the counter here:

[https://github.com/discourse/discourse/pull/5698](https://github.com/discourse/discourse/pull/5698)

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [March 23, 2018, 2:24pm UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/8 "2018-03-23T14:24:33Z")

</div>

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

[https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc 2](https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc)

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 23, 2018, 11:30pm UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/9 "2018-03-23T23:30:37Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/3/5/35cf7e3c142160730438cc6d2b64b7506625abae.png)

Confirmed looks good, results in:

dolor sit amet [https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc 2](https://example.com/NQoiffrCbcaZHcKQe5syENZiKWsvEc) onsetetur

Great idea @yanokwa

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [September 17, 2018, 11:22am UTC](https://meta.discourse.org/t/copying-a-link-includes-the-click-count/83531/10 "2018-09-17T11:22:25Z")

</div>


