# Links with multiple dots aren’t linking right

**URL:** https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781
**Category:** Bug
**Created:** [March 11, 2022, 10:31pm UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781 "2022-03-11T22:31:21Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 11, 2022, 10:31pm UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/1 "2022-03-11T22:31:21Z")

</div>

If a link has more than one dot, composer don’t know how to handle it after second dot. Like this one:

[https://www.sell.fi/sites/default/files/elainlaakarilehti/tieteelliset\_artikkelit/kahkonen\_t.\_et\_al.\_canine\_pancreatitis\_-\_review.pdf](https://www.sell.fi/sites/default/files/elainlaakarilehti/tieteelliset_artikkelit/kahkonen_t._et_al._canine_pancreatitis_-_review.pdf)

Bug or feature?

---

<div class="post-metadata">

### Author: ![qwe\_rfv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/qwe_rfv/32/248878_2.png) [@qwe\_rfv](https://meta.discourse.org/u/qwe_rfv)
#### Post date: [March 12, 2022, 6:48am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/2 "2022-03-12T06:48:13Z")

</div>

[https://www.sell.fi/sites/default/files/elainlaakarilehti/tieteelliset\_artikkelit/kahkonen\_t.\_et\_al.canine\_pancreatitis-\_review.pdf](https://www.sell.fi/sites/default/files/elainlaakarilehti/tieteelliset_artikkelit/kahkonen_t._et_al.canine_pancreatitis-_review.pdf)  
I think you used emphasis effect writing `canine_pancreatitis`. like _this text_.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [March 12, 2022, 6:53am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/3 "2022-03-12T06:53:03Z")

</div>

The italics are because of the underscore after the second period. If you wrap the link in \< \> I think it displays properly:

[https://www.sell.fi/sites/default/files/elainlaakarilehti/tieteelliset\_artikkelit/kahkonen\_t.\_et\_al.\_canine\_pancreatitis\_-\_review.pdf](https://www.sell.fi/sites/default/files/elainlaakarilehti/tieteelliset_artikkelit/kahkonen_t._et_al._canine_pancreatitis_-_review.pdf)

`<https://www.sell.fi/sites/default/files/elainlaakarilehti/tieteelliset_artikkelit/kahkonen_t._et_al._canine_pancreatitis_-_review.pdf>`

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 12, 2022, 7:18am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/4 "2022-03-12T07:18:46Z")

</div>

Every day something new. I didn’t know underscores does italic too.

So… it is feature, not bug 🤣

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [March 12, 2022, 7:36am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/5 "2022-03-12T07:36:26Z")

</div>

Well, the auto-linking is getting confused by the multiple periods in the pdf link, and starts reading the following underscores as markdown, which might not be desirable?

But the escape \<\> wrap is a good workaround if you need it. 👍

---

<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 12, 2022, 11:30pm UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/6 "2022-03-12T23:30:16Z")

</div>

It is something that @Vitaly ia tracking, really depends on how common these issues are. If it is 1 in a million links it is not worth improving the linkifier, if it is 1 in 10 it certainly is

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 13, 2022, 6:42am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/7 "2022-03-13T06:42:19Z")

</div>

It depends. If there is need to share scientific links and pdfs, as on my forum, it is really common covering almost every link. Otherwise, not so often but more than one dot is not so rare form either.

From my point of view — is there some reason why starting http:// or https:// and ending to a space is not enough, plus allowed fileforms of course?

---

<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 13, 2022, 6:58am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/8 "2022-03-13T06:58:41Z")

</div>

> [@Jagster](#):
>
> is there some reason why starting http:// or https:// and ending to a space is not enough, plus allowed fileforms of course?

The rules are complex and evolving.

> <https://stackoverflow.com/questions/1547899/which-characters-make-a-url-invalid/36667242#36667242>

The linkifier also works without `https://` prefix to add extra complexity.

I suspect that we could do something to relax the linkifiers behaviour for the `https://` prefix case, but will leave Vitaly to weigh in.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [March 13, 2022, 7:04am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/9 "2022-03-13T07:04:31Z")

</div>

> [@sam](#):
>
> The rules are complex and evolving

That is somehow my point 😉

Well, I’m trying to teach users to use `<` and `>`. The biggest UX’ish issue here is Discourse starts to act in many cases too differently than users are expecting. But that is much deeper thing than just trying to remember when links work and when not.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 13, 2022, 11:04am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/10 "2022-03-13T11:04:31Z")

</div>

> [@sam](#):
>
> suspect that we could do something to relax the linkifiers behaviour for the `https://` prefix case, but will leave Vitaly to weigh in.

That makes sense to me. I think it mount be ok to only linkify bare host names and require urls with a path to have http.

---

<div class="post-metadata">

### Author: ![Vitaly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vitaly/32/120475_2.png) [@Vitaly](https://meta.discourse.org/u/Vitaly)
#### Post date: [March 29, 2022, 6:32am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/11 "2022-03-29T06:32:53Z")

</div>

I’ve recorded test case but with high probability it’s the same emphasis-based issue as before.

In general, all links with protocol `http(s)://` can be fixed, and i start working on this very soon (really).

Fuzzy links have no realistic solution (and will open door to ReDoS). But, as i said many times, added value of this mode is not obvious, and it’s disabled by default because of many side effects. I did it only because other packages provided it.

---

<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 29, 2022, 7:19am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/12 "2022-03-29T07:19:15Z")

</div>

I think resolving the `http(s)://` case will give enormous amounts of mileage.

Vast majority of people are just copying a URL from the address bar of the browser, it certainly includes protocol.

---

<div class="post-metadata">

### Author: ![Vitaly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vitaly/32/120475_2.png) [@Vitaly](https://meta.discourse.org/u/Vitaly)
#### Post date: [March 29, 2022, 7:20am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/13 "2022-03-29T07:20:55Z")

</div>

Indeed. I don’t know real cases where links without protocol can be useful.

---

<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 29, 2022, 7:25am UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/14 "2022-03-29T07:25:11Z")

</div>

It is usually for edge cases where users remember a domain and just want to type it in. Usually a path is not involved, a query param … almost never.

Eg:

> Hey… did you check out [discourse.org](http://discourse.org)

---

<div class="post-metadata">

### Author: ![Vitaly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vitaly/32/120475_2.png) [@Vitaly](https://meta.discourse.org/u/Vitaly)
#### Post date: [April 22, 2022, 5:23pm UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/15 "2022-04-22T17:23:49Z")

</div>

IMO forcing such users to type `https://` for such links is more simple, than fighting side effects of fuzzy mode.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 20, 2022, 12:23pm UTC](https://meta.discourse.org/t/links-with-multiple-dots-aren-t-linking-right/220781/17 "2022-06-20T12:23:44Z")

</div>

See also: [Links broken with (at least) two underscores in URL](https://meta.discourse.org/t/links-broken-with-at-least-two-underscores-in-url/72976)
