How do you write a link containing a closing brack

2019-01-26 09:51发布

问题:

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

回答1:

You can try to escape the character:

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


回答2:

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.



回答3:

You don't have to scape it at all.

On GitHub, I've just done the following without any problems:

[Slowloris](https://en.wikipedia.org/wiki/Slowloris_(computer_security))

Actually, even here you can use it directly, as you can see here.