Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you write a link containing a closing bracket in markdown syntax?

Tags:

Markdown syntax for a link is pretty simple:

[Example](http://example.com/) 

produces:

Example

But what if the link itself contains a closing bracket?

[Syntax](http://en.wikipedia.org/wiki/Syntax_(programming_languages)) 

produces:

Syntax)

which is obviously broken.

Edit

Putting the url in quotes does not work

like image 776
Nick Brunt Avatar asked Dec 11 '12 16:12

Nick Brunt


People also ask

How do you do brackets in markdown?

Markdown supports two style of links: inline and reference. In both styles, the link text is delimited by [square brackets]. To create an inline link, use a set of regular parentheses immediately after the link text's closing square bracket.

What is the syntax to insert a link in markdown?

Markdown syntax for a hyperlink is square brackets followed by parentheses. The square brackets hold the text, the parentheses hold the link.

How do you pass brackets in URL?

Parentheses “()” may be used as such in the query part of URL (i.e., the part after “?”). It is allowable, but not necessary, to %-encode them, as “%28” and “%29”. Brackets “[]” shall be %-encoded, as “%5B” and “%5D”, in the query part.

How do you add a link in R markdown?

Hyperlinks are created using the syntax [text](link) , e.g., [RStudio](https://www.rstudio.com) . The syntax for images is similar: just add an exclamation mark, e.g., ![ alt text or image title](path/to/image) . Footnotes are put inside the square brackets after a caret ^[] , e.g., ^[This is a footnote.] .


2 Answers

Sometimes you need to encode ) with %29.

[Syntax](http://en.wikipedia.org/wiki/Syntax_(programming_languages%29) 

E.g.: This was the only method I could find to get a correct Markdown preview in the Atom Editor.

like image 92
ovhaag Avatar answered Oct 04 '22 21:10

ovhaag


You can try to escape the character:

[Syntax](http://en.wikipedia.org/wiki/Syntax_\(programming_languages\)) 

You can also encode the characters

[Syntax](http://en.wikipedia.org/wiki/Syntax_%28programming_languages%29) 
like image 39
Luis Tellez Avatar answered Oct 04 '22 21:10

Luis Tellez