Links with parentheses in markdown

Hi, I’m wondering how to render properly a link with parentheses in markdown. I can’t escape the link’s ‘)

Here are some shy attempts of mine:

( is %28 and ) is %29:

My [working link](https://en.wikipedia.org/wiki/Parenthesis_(disambiguation%29)

2 Likes

Lol, good example link @Fil!

I also sometimes fall back on writing out the HTML. It’s not totally satisfying, but good to remember you can write HTML in Markdown!

<a href="https://en.wikipedia.org/wiki/Parenthesis_(disambiguation)">working link</a>. 
3 Likes

To my knowledge Fil’s example is the only suitable workaround for older Markdown implementations if you don’t want to fall back to HTML.

The current CommonMark spec accounts for parentheses insofar that you can have a matching number of opening and closing parens in the URL part. Discourse uses Markdown-It which is 100% spec-compliant, so this dummy link is parsed correctly.

Unfortunately Observable still includes a legacy version of Marked and will continue to do so until version pinning for the Standard Library has been added (more in this issue).

You can compare the differences between Marked versions at this link.