# Display of images in links break if they contain parenthesis

**URL:** https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271
**Category:** Bug
**Tags:** markdown-it-review
**Created:** [31.Октябрь.2016 21:08:29 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271 "2016-10-31T21:08:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [31.Октябрь.2016 21:08:29 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271/1 "2016-10-31T21:08:29Z")

</div>

To reproduce:

```
[![Some text](https://example.com/stupid(66)filename.png)](https://example.com/stupid(66)filename.png)

```

Of course, a better solution might be to include just the raw image link on a line by itself. I may just need to deal with image links more elegantly. . .

---

<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: [31.Октябрь.2016 21:34:21 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271/2 "2016-10-31T21:34:21Z")

</div>

See

> <https://meta.stackexchange.com/questions/13501/links-to-urls-containing-parentheses/13509#13509>

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [31.Октябрь.2016 23:52:02 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271/3 "2016-10-31T23:52:02Z")

</div>

I’d checked that. It’s not links to urls with parentheses that I’m having with, but links to URLs containing parentheses when the displayed text is an image whose url contains a parenthesis. In html, it’d be

```
<a href="http://x.com/really(silly)filename.png"><img src="http://x.com/really(silly)filename.png"></a>

```

I am pretty sure that this won’t work in our Markdown (the code that generates that markdown works fine if the image URL doesn’t contain parentheses) and that what I need to do is for such links, just replace the whole thing with

```
http://x.com/really(silly)filename.png

```

I can’t imagine that a human would ever do it the other way, so I’ll just have to cowboy up and deal with images that contain parentheses some other way (or even just all display-an-image-with-a-link-to-the-image instances).

---

<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: [01.Ноябрь.2016 04:07:26 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271/4 "2016-11-01T04:07:26Z")

</div>

Replace the parens with the URL encoded versions per the link I posted…

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [01.Ноябрь.2016 16:27:12 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271/5 "2016-11-01T16:27:12Z")

</div>

Apparently I was capable of reading only the other 6 ways. ☹

Thanks.

---

<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: [26.Июнь.2017 14:02:33 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271/6 "2017-06-26T14:02:33Z")

</div>

This now looks right to me:

```plaintext
[![Some text](https://example.com/stupid(66)filename.png)](https://example.com/stupid(66)filename.png)

```

> [@CommonMark testing started here!](https://meta.discourse.org/t/commonmark-testing-started-here/65121):
>
> Per our [migration plans](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon), I just enabled [markdown.it](https://github.com/markdown-it/markdown-it) at Meta. It is an excellent [CommonMark](http://commonmark.org/) compliant engine. I expect quite a few edges to be found during this period of testing. Do not open bugs about the new Engine, just reply here. I/we will be updating the top post here with the list of issues and striking out stuff as it is fixed. Current known issues (to be fixed)white_check_mark Onebox vanishes after you start typing and works not-super consistently white_check_mark pending…

---

<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: [26.Июнь.2017 14:02:39 UTC](https://meta.discourse.org/t/display-of-images-in-links-break-if-they-contain-parenthesis/52271/7 "2017-06-26T14:02:39Z")

</div>


