# Onebox Twitter embedding failing when URL contains valid Markdown

**URL:** https://meta.discourse.org/t/onebox-twitter-embedding-failing-when-url-contains-valid-markdown/95009
**Category:** Support
**Created:** [August 17, 2018, 4:15pm UTC](https://meta.discourse.org/t/onebox-twitter-embedding-failing-when-url-contains-valid-markdown/95009 "2018-08-17T16:15:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![marcozambi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcozambi/32/119505_2.png) [@marcozambi](https://meta.discourse.org/u/marcozambi)
#### Post date: [August 17, 2018, 4:15pm UTC](https://meta.discourse.org/t/onebox-twitter-embedding-failing-when-url-contains-valid-markdown/95009/1 "2018-08-17T16:15:10Z")

</div>

It’s quite a rare case, but if the URL of a link to Twitter contains vaild Markdown syntax, this breaks the embedding.

For example `https://twitter.com/_TomCross_/status/1030208369116827652` won’t be embedded.

[https://twitter.com/\_TomCross\_/status/1030208369116827652](https://twitter.com/_TomCross_/status/1030208369116827652)

To have a correct embedding I need to add an escape \ character in front of the first \_

[https://twitter.com/\_TomCross\_/status/1030208369116827652](https://twitter.com/%5C_TomCross_/status/1030208369116827652)

---

<div class="post-metadata">

### Author: ![danekhollas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danekhollas/32/79637_2.png) [@danekhollas](https://meta.discourse.org/u/danekhollas)
#### Post date: [August 17, 2018, 4:22pm UTC](https://meta.discourse.org/t/onebox-twitter-embedding-failing-when-url-contains-valid-markdown/95009/2 "2018-08-17T16:22:16Z")

</div>

Possibly a duplicate of this one:

> [@Oneboxing URLs with two dashes](https://meta.discourse.org/t/oneboxing-urls-with-two-dashes/84568/):
>
> Ok, here’s a weird bug. When an URL contains --, the markdown converts it do – For example, this URL: cs--preview.khanacademy.org If I explicitly insert a link, it works, even though it is rendered incorectly: [https://cs--preview.khanacademy.org](https://cs--preview.khanacademy.org) [https://cs–preview.khanacademy.org](https://cs--preview.khanacademy.org) PS: Hm, linkifying seems to be disabled here on meta, but hopefully the second example makes things clear.

By the way, this is not really about embedding, the link itself does not work, as you demonstrated.

---

<div class="post-metadata">

### Author: ![marcozambi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcozambi/32/119505_2.png) [@marcozambi](https://meta.discourse.org/u/marcozambi)
#### Post date: [August 17, 2018, 4:24pm UTC](https://meta.discourse.org/t/onebox-twitter-embedding-failing-when-url-contains-valid-markdown/95009/3 "2018-08-17T16:24:55Z")

</div>

Sure. I was wondering whether the URL could be somehow sanitized in the embedding code…

---

<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: [August 17, 2018, 10:51pm UTC](https://meta.discourse.org/t/onebox-twitter-embedding-failing-when-url-contains-valid-markdown/95009/4 "2018-08-17T22:51:07Z")

</div>


