BBcode [url] deletes parts of a link

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.

In a markdown url and in a html link, also.

But in a BBcode link the tag disappears.

It affects also an url with the characters & in it

But everything works if we remove the = character, like this.

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

4 Likes

Nice catch, parsing bbcode attributes sure is fun!

Fixed per:

https://github.com/discourse/discourse/commit/1096dcd6022b4b03e178b5ea3fde8d588f3c7f4c

6 Likes