# BBcode \[url\] deletes parts of a link

**URL:** https://meta.discourse.org/t/bbcode-url-deletes-parts-of-a-link/66478
**Category:** Bug
**Created:** [July 20, 2017, 1:21am UTC](https://meta.discourse.org/t/bbcode-url-deletes-parts-of-a-link/66478 "2017-07-20T01:21:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 20, 2017, 1:21am UTC](https://meta.discourse.org/t/bbcode-url-deletes-parts-of-a-link/66478/1 "2017-07-20T01:21:10Z")

</div>

I came across a **little** bug while updating a topic.

I used the bbcode url for an old topic and some links in this url had a tag (for a partnership). In the preview and in the published post, the tag disappeared. I fixed it quite easily by using a html link instead but I think it is relevant to share this little issue. I may cause an issue or two with a phpbb/ipb importer.

I’ll give an example. I’ll invent an amazon tag on some product. In the onebox, the tag works perfectly.

> **[Amazon.com : Camcorder,Hausbell 302S Remote Control Camcorder, FHD Infrared...](https://www.amazon.com/Hausbell-302S-HAUSBELL-Camcorder-Black/dp/B01KLOA1PI)**
>
> Amazon.com : Camcorder,Hausbell 302S Remote Control Camcorder, FHD Infrared Night Vision 1080p 24 MP Digital Camcorder Video Camera with 3.0" LCD, Touch Screen and HDMI Output : Electronics

In a [markdown url](https://www.amazon.com/Camcorder-Hausbell-302S-Control-Infrared/dp/B01KLOA1PI/?tag=discourse) and in a [html link](https://www.amazon.com/Camcorder-Hausbell-302S-Control-Infrared/dp/B01KLOA1PI/?tag=discourse), also.

**But** in a [BBcode link](https://www.amazon.com/Camcorder-Hausbell-302S-Control-Infrared/dp/B01KLOA1PI/?tag=discourse) the tag disappears.

It affects also an url with the characters & in it

But everything works if we remove the = character, [like this](https://www.amazon.com/Camcorder-Hausbell-302S-Control-Infrared/dp/B01KLOA1PI/?tagdiscourse).

For a native Discourse, there will not be any problem, so it’s really a minor bug I think.

---

<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: [July 20, 2017, 5:03pm UTC](https://meta.discourse.org/t/bbcode-url-deletes-parts-of-a-link/66478/2 "2017-07-20T17:03:14Z")

</div>

Nice catch, parsing bbcode attributes sure is fun!

Fixed per:

[https://github.com/discourse/discourse/commit/1096dcd6022b4b03e178b5ea3fde8d588f3c7f4c](https://github.com/discourse/discourse/commit/1096dcd6022b4b03e178b5ea3fde8d588f3c7f4c)

---

<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: [July 20, 2017, 5:03pm UTC](https://meta.discourse.org/t/bbcode-url-deletes-parts-of-a-link/66478/3 "2017-07-20T17:03:18Z")

</div>


