# Some links are misinterpreted

**URL:** <https://meta.discourse.org/t/some-links-are-misinterpreted/195434>\
**Category:** Bug\
**Created:** [June 30, 2021, 12:51am UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434 "2021-06-30T00:51:15Z")\
**Posts on this page:** 8\
**Page:** 1

## AI-generated summary

A bug report highlights that some Amazon-generated links containing double underscores (e.g., `__mk_fr_FR`) are misinterpreted by the forum’s markdown parser, causing broken or malformed links [CamilleRoux](/t/-/195434/1). A workaround using angle brackets `<link>` is noted [Vitaly](/t/-/195434/3), referencing a long-standing issue in the markdown-it library. Vitaly seeks real-world data on whether URLs commonly end with `_`, `~`, `-`, or `+` to inform a parser rewrite, asking for help scanning large markdown datasets [Vitaly](/t/-/195434/4). [sam](/t/-/195434/5) provides limited stats from Meta: `-` appears in 181 links, `_` in 58, `+` in 8, and `~` in just 2. They suggest querying Stack Exchange’s public data for more examples. Vitaly requests visual examples or direct links to those posts [Vitaly](/t/-/195434/6). Finally, [JammyDodger](/t/-/195434/7) suggests consolidating the issue with an existing thread on Meta Discourse about links broken by multiple underscores, and closes this topic.

<div class="post-metadata">

**Author:** ![CamilleRoux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/camilleroux/32/119575_2.png) [@CamilleRoux](https://meta.discourse.org/u/CamilleRoux)\
**Post date:** [June 30, 2021, 12:51am UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/1 "2021-06-30T00:51:16Z")

</div>

Some links generated by Amazon are not correctly interpreted. Here is an exemple:

> **[La Partition intérieure : jazz, musiques improvisées : Siron, Jacques:...](https://www.amazon.fr/-/en/Partition-int%C3%A9rieure-jazz-musiques-improvis%C3%A9es/dp/2907891030)**
>
> La Partition intérieure : jazz, musiques improvisées : Siron, Jacques: Amazon.fr: Books

Here is a screen capture:

 ![Capture d’écran 2021-06-30 à 02.48.05](https://global.discourse-cdn.com/meta/original/3X/5/f/5f491ddf13a796e707fde89d3f4da0dbafae9458.png)

Here is the [link](https://www.amazon.fr/Partition-int%C3%A9rieure-jazz-musiques-improvis%C3%A9es/dp/2907891030?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=partition+int%C3%A9rieure&qid=1625013895&sr=8-1&linkCode=ll1&tag=theoriemusicale-21&linkId=87d44c3dedd4b919e02195911a7a2b0d&language=fr_FR&ref_=as_li_ss_tl):  
`https://www.amazon.fr/Partition-int%C3%A9rieure-jazz-musiques-improvis%C3%A9es/dp/2907891030?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=partition+int%C3%A9rieure&qid=1625013895&sr=8-1&linkCode=ll1&tag=theoriemusicale-21&linkId=87d44c3dedd4b919e02195911a7a2b0d&language=fr_FR&ref_=as_li_ss_tl`

The problem seems to come from the double underscore

PS: Great book by the way 🙂

---

<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:** [June 30, 2021, 1:12am UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/2 "2021-06-30T01:12:28Z")

</div>

@Vitaly is this something we should report on the markdown.it repo?

---

<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:** [January 7, 2022, 7:54am UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/3 "2022-01-07T07:54:12Z")

</div>

That’s still known issue, [linkify doesn't accept urls with underscores · Issue #38 · markdown-it/markdown-it · GitHub](https://github.com/markdown-it/markdown-it/issues/38), workarounded with `<link>` (angle brackets around link). Nothing new to report.

Still no deadlines. Good news is: i finally rolled out to production my new forum software [https://rcopen.com/](https://rcopen.com/) (why a lot of resources been spent to create `markdown-it`). So, chances to fix this bug changed from “far infinity” to “some future” 🙂

---

<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:** [January 7, 2022, 11:59am UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/4 "2022-01-07T11:59:57Z")

</div>

@sam, help required. I need info, can links from real world end with `_`, `~`, `-` or `+`.

`http://example.com/?sdf,wer-` and so on.

That’s important to know before `markdown-it`’s linkifier rewrite. Could you grep some huge postings databases for such cases and let me know if anything found or not found? Probably, those links were posted as `<...>` for workaround. So, regexp pattern for db scan will be something like `/<http.+[+~_-]>/g` (not tested)

I have no access to such big volume of markdown texts to reach acceptable confidence. May be you could help, or know anyone who could help?

---

<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:** [January 11, 2022, 5:19am UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/5 "2022-01-11T05:19:27Z")

</div>

> [@Vitaly](#):
>
> I need info, can links from real world end with `_` , `~` , `-` or `+`

We don’t have access to customer data, but on meta

`-` : medium rare (181)  
`_` : rare (58)  
`+` : very rare (8)  
`~` : almost never (2)

There is also this corpus you can query: [https://data.stackexchange.com/](https://data.stackexchange.com/) which may help you get more data (you can query Stack sites)

---

<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:** [January 12, 2022, 6:00pm UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/6 "2022-01-12T18:00:06Z")

</div>

Interesting. Could you send me to PM all those links from meta db? Need to see visually

OR, if possible - link to postings, where those links were found

> [@sam](#):
>
> There is also this corpus you can query: [https://data.stackexchange.com/](https://data.stackexchange.com/) which may help you get more data (you can query Stack sites)

Thank you for info. Will take a look.

---

<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:** [August 8, 2022, 2:47pm UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/7 "2022-08-08T14:47:26Z")

</div>

I believe this is most recently being tracked in:

> [@Links broken with (at least) two underscores in URL](https://meta.discourse.org/t/links-broken-with-at-least-two-underscores-in-url/72976/8):
>
> Could we fix this by doing the work in our paste handler, and if we’re pasting a URL, percent-encode underscores in the query string?

I’ll close this off in favour of that one. 👍

---

<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:** [August 8, 2022, 2:47pm UTC](https://meta.discourse.org/t/some-links-are-misinterpreted/195434/8 "2022-08-08T14:47:30Z")

</div>

Closed on August 8, 2022, 2:47pm UTC


