# באג ב-onebox - הקישור מוצג כ-Gist למרות שהוא לא

**URL:** https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463
**Category:** Support
**Created:** [2 בספטמבר,‏ 2021,‏ 2:30pm UTC](https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463 "2021-09-02T14:30:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [2 בספטמבר,‏ 2021,‏ 2:30pm UTC](https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463/1 "2021-09-02T14:30:10Z")

</div>

There seems to be a bug in Onebox where a link is being shown as a Gist when it’s just a Medium article, here’s the link:

[https://medium.com/pragmatic-programmers/circuit-breakers-and-you-ab1281c88f99](https://medium.com/pragmatic-programmers/circuit-breakers-and-you-ab1281c88f99)

(Same thing happening here)

---

<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: [3 בספטמבר,‏ 2021,‏ 1:38am UTC](https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463/2 "2021-09-03T01:38:04Z")

</div>

Oh, yikes, we should fix that, looks like a bad regex somewhere @techAPJ can you sort this out.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [5 בספטמבר,‏ 2021,‏ 9:34am UTC](https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463/4 "2021-09-05T09:34:43Z")

</div>

I believe this is an issue on the Medium side. I am seeing this canonical link in the source of the linked article:

```plaintext
<link data-rh="true" rel="canonical" href="https://gist.github.com/139a99b16e8d1fb37b1b3634b14d9052"/>

```

Onebox library always follows the canonical link.

Other Medium articles are oneboxing fine so it might be a regression in Medium articles with Gist embedded.

We can add [medium.com](http://medium.com) to the list of domains to [ignore canonical tag](https://github.com/discourse/discourse/blob/1472e47aae5bfdfb6fd9abfe89beb186c751f514/lib/onebox/helpers.rb#L10), should we do that @sam? Note that Medium allows custom domains so this will not work in all the cases.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [9 בספטמבר,‏ 2021,‏ 3:20am UTC](https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463/5 "2021-09-09T03:20:25Z")

</div>

> [@techAPJ](#):
>
> We can add [medium.com](http://medium.com) to the list of domains to [ignore canonical tag](https://github.com/discourse/discourse/blob/1472e47aae5bfdfb6fd9abfe89beb186c751f514/lib/onebox/helpers.rb#L10)

Done via:

[https://github.com/discourse/discourse/commit/11a07b37e15f20f5de960243b9ad611fd477af6b](https://github.com/discourse/discourse/commit/11a07b37e15f20f5de960243b9ad611fd477af6b)

Example:

[https://medium.com/pragmatic-programmers/circuit-breakers-and-you-ab1281c88f99](https://medium.com/pragmatic-programmers/circuit-breakers-and-you-ab1281c88f99)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [9 בספטמבר,‏ 2021,‏ 3:20am UTC](https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463/6 "2021-09-09T03:20:31Z")

</div>


