# A comma followed by an underscore in a URL results in defunct link

**URL:** https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696
**Category:** Bug
**Tags:** markdown-it-review
**Created:** [2016 年2 月 16 日 21:03 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696 "2016-02-16T21:03:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### 作者： ![adrelanos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/adrelanos/32/121409_2.png) [@adrelanos](https://meta.discourse.org/u/adrelanos)
#### 发布日期： [2016 年2 月 16 日 21:03 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696/1 "2016-02-16T21:03:55Z")

</div>

`<a href="https://www.whonix.org/wiki/Comparison_Of_Tor_with_CGI_Proxies,_Proxy_Chains,_and_VPN_Services#Comparison_of_Tor_and_VPN_services">here</a>`

results in:

[here](https://www.whonix.org/wiki/Comparison_Of_Tor_with_CGI_Proxies,_Proxy_Chains,_and_VPN_Services#Comparison_of_Tor_and_VPN_services)

`https://www.whonix.org/wiki/Comparison_Of_Tor_with_CGI_Proxies,%3Cem%3EProxy%3C/em%3EChains,%3Cem%3Eand%3C/em%3EVPN_Services#Comparison_of_Tor_and_VPN_services`

It adds extra `<em>` after the comma.

Not great to have `,` inside links indeed, but I perhaps this could be fixed anyhow?

---

<div class="post-metadata">

### 作者： ![kpfleming](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kpfleming/32/116414_2.png) [@kpfleming](https://meta.discourse.org/u/kpfleming)
#### 发布日期： [2016 年2 月 16 日 21:12 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696/2 "2016-02-16T21:12:41Z")

</div>

Spaces are not allowed in URLs, they are supposed to be URL-encoded. Commas should be URL-encoded as well. How did you obtain a URL with embedded commas and spaces?

---

<div class="post-metadata">

### 作者： ![calmh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/calmh/32/115466_2.png) [@calmh](https://meta.discourse.org/u/calmh)
#### 发布日期： [2016 年2 月 16 日 21:23 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696/3 "2016-02-16T21:23:24Z")

</div>

Both commas and underscores (which I think is the problematic character here) are perfectly fine in URLs. The comma is a reserved character so may be percent escaped to avoid it being interpreted in a reserved manner by the server, but the client shouldn’t care either way.

In this case it looks like the markdown parser is looking too deep into the tag…

---

<div class="post-metadata">

### 作者： ![tibarra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tibarra/32/52222_2.png) [@tibarra](https://meta.discourse.org/u/tibarra)
#### 发布日期： [2016 年3 月 16 日 22:32 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696/7 "2016-03-16T22:32:09Z")

</div>

And how is the URL supposed to be @adrelanos?

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2016 年3 月 16 日 23:11 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696/8 "2016-03-16T23:11:03Z")

</div>

Logic is in a nasty regex that I do not want to hack on, we get a brand new regex with the new markdown engine, this fix will have to wait till then

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2017 年6 月 26 日 19:30 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696/9 "2017-06-26T19:30:42Z")

</div>

> [@adrelanos](#):
>
> [Whonix versus Proxies](https://www.whonix.org/wiki/Comparison_Of_Tor_with_CGI_Proxies,_Proxy_Chains,_and_VPN_Services#Comparison_of_Tor_and_VPN_services)

This now works, for added bonus it also auto links correctly.

> [@CommonMark testing started here!](https://meta.discourse.org/t/commonmark-testing-started-here/65121):
>
> Per our [migration plans](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon), I just enabled [markdown.it](https://github.com/markdown-it/markdown-it) at Meta. It is an excellent [CommonMark](http://commonmark.org/) compliant engine. I expect quite a few edges to be found during this period of testing. Do not open bugs about the new Engine, just reply here. I/we will be updating the top post here with the list of issues and striking out stuff as it is fixed. Current known issues (to be fixed)white_check_mark Onebox vanishes after you start typing and works not-super consistently white_check_mark pending…

---

<div class="post-metadata">

### 作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### 发布日期： [2017 年6 月 26 日 19:31 UTC](https://meta.discourse.org/t/a-comma-followed-by-an-underscore-in-a-url-results-in-defunct-link/39696/10 "2017-06-26T19:31:05Z")

</div>


