# אנא אל תקשרו קישורים כפולים אם מדביקים קישור על גבי קישור ב-markdown

**URL:** https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793
**Category:** Bug
**Created:** [2 בדצמבר,‏ 2021,‏ 12:24am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793 "2021-12-02T00:24:28Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [2 בדצמבר,‏ 2021,‏ 12:24am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/1 "2021-12-02T00:24:28Z")

</div>

Continuing the discussion from [Idea: Paste links in the editor](https://meta.discourse.org/t/idea-paste-links-in-the-editor/47125/20):

I just ran into this and it was driving me crazy. I had a link in a post that went to the wrong place:

```plaintext
[The Right Place](https://example.org/the-wrong-url)

```

and I noticed that and copied the right URL, `https://example.org/the-right-place`, and then pasted it, and got this confusing result:

```plaintext
[The Right Place]([https://example.org/the-wrong-url](https://example.org/the-right-place))

```

Huh. I thought. Let me try that again. Is there some sort of new Firefox/Wayland past bug? So I selected the part in between the `()`s again, and…

```plaintext

[The Right Place]([[https://example.org/the-wrong-url](https://example.org/the-right-place)](https://example.org/the-right-place))

```

OMG SO CONFUSED!!!1

Then I happened to remember I’d happened to scroll by the topic linked above the other day. I’m glad I had, because I guarantee you I would have been perplexed for a much longer time than one would hope from a person who is supposed to be smart.

Can this code _please_ be adjusted to not do this _at least_ to text that is a markdown link, but actually probably never to any URL ever, because

```plaintext
[https://example.org/the-wrong-url](https://example.org/the-right-place)

```

doesn’t seem like something anyone should be encouraged to do — let alone possible tricked into doing by the software trying to be helpful at the wrong time.

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2 בדצמבר,‏ 2021,‏ 1:55am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/2 "2021-12-02T01:55:53Z")

</div>

> [@mattdm](#):
>
> I noticed that and copied the right URL, `https://example.org/the-right-place` , and then pasted it, and got this confusing result

What exactly did you highlight when you pasted the second time? If the markdown is already set to `[The Right Place](https://example.org/the-wrong-url)`, I highlight `https://example.org/the-wrong-url` and paste `https://example.org/the-right-place`, it just replaces the first URL with the second.

> [@mattdm](#):
>
> Can this code _please_ be adjusted to not do this _at least_ to text that is a markdown link, but actually probably never to any URL ever, because
> 
> ```plaintext
> [https://example.org/the-wrong-url](https://example.org/the-right-place)
> 
> ```
> 
> doesn’t seem like something anyone should be encouraged to do — let alone possible tricked into doing by the software trying to be helpful at the wrong time.

Also, pasting a standalone URL on top of another URL just replaces it. It doesn’t do this as far as I can see.

Maybe these issues have already been fixed?

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [2 בדצמבר,‏ 2021,‏ 2:00am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/3 "2021-12-02T02:00:17Z")

</div>

I just checked, and while it doesn’t happen here, it _does_ happen on the Fedora sites and on [https://discuss.python.org/](https://discuss.python.org/). Perhaps there’s a fix in testing here that hasn’t gone out to hosted sites generally?

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [2 בדצמבר,‏ 2021,‏ 2:03am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/4 "2021-12-02T02:03:10Z")

</div>

I think there’s generally a delay between a change making it to Meta and making it to hosted sites. I don’t know the general timeline or if it differs by customer, but I usually see changes on Meta make it to the hosted site I use within a few days.

---

<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: [2 בדצמבר,‏ 2021,‏ 4:43am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/5 "2021-12-02T04:43:01Z")

</div>

Can you reproduce this on meta? I just tried and could not reproduce the issue in the OP.

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [2 בדצמבר,‏ 2021,‏ 6:25am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/6 "2021-12-02T06:25:28Z")

</div>

As noted, can’t reproduce this on meta but _can_ reproduce it on both Fedora sites and on the Python one. So if you didn’t fix it on purpose, something is still wrong somewhere. :slight_smile:

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2 בדצמבר,‏ 2021,‏ 7:42am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/7 "2021-12-02T07:42:22Z")

</div>

Maybe these sites need to update.

> [@New behavior when Copy/Pasting links](https://meta.discourse.org/t/new-behavior-when-copy-pasting-links/210721/6):
>
> Updated in [UX: only apply link formats on paste to selections that do not contain links by gwwar · Pull Request #15159 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/15159)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2 בדצמבר,‏ 2021,‏ 1:30pm UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/10 "2021-12-02T13:30:28Z")

</div>

> [@Moin](#):
>
> Maybe these sites need to update.

Yes I think you’re right - this was fixed yesterday:

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

@mattdm I’ll run a deploy on your site right now, so the fix should be live in the next few minutes

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [2 בדצמבר,‏ 2021,‏ 2:51pm UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/12 "2021-12-02T14:51:19Z")

</div>

> [@mattdm](#):
>
> I just checked, and while it doesn’t happen here, it _does_ happen on the Fedora sites

This also happens on my site, which I mentioned in my second edit in [this topic](https://meta.discourse.org/t/new-behavior-when-copy-pasting-links/210721).

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [2 בדצמבר,‏ 2021,‏ 2:53pm UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/13 "2021-12-02T14:53:35Z")

</div>

אני אוודא שהתיקון הזה יופץ בכל שרתי הפרו/עסקי שלנו בשעה הקרובה בערך

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [2 בדצמבר,‏ 2021,‏ 3:56pm UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/14 "2021-12-02T15:56:53Z")

</div>

Thank you so much!

I do like the feature in general — it is indeed quite convenient to write a paragraph and then go back and add in links on a whim.

---

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [3 בדצמבר,‏ 2021,‏ 2:21pm UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/15 "2021-12-03T14:21:19Z")

</div>

Update - my site seems to be back to normal now. Thanks so much!

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [4 בדצמבר,‏ 2021,‏ 8:00am UTC](https://meta.discourse.org/t/please-dont-double-link-urls-if-one-pastes-over-a-url-in-markdown/210793/16 "2021-12-04T08:00:47Z")

</div>

This topic was automatically closed after 42 hours. New replies are no longer allowed.
