9

This may be related to this question: Comment bug with URLs and square brackets, however it still appears to be an issue for me.

I wanted to leave a comment with a link, so I typed:

[Convert.ToBase64String(byte[])](http://msdn.microsoft.com/en-us/library/dhx0d524(v=vs.110).aspx)

Which displayed the following:

[Convert.ToBase64String(byte[])](msdn.microsoft.com/en-us/library/dhx0d524(v=vs.110).aspx)

I had to escape the byte[] part in a code block:

[Convert.ToBase64String(`byte[]`)](http://msdn.microsoft.com/en-us/library/dhx0d524(v=vs.110).aspx)

And it worked fine. Is this expected behavior? Is there any way I can escape those square brackets inside my link?

2
9

Use backslashes to escape the literal brackets:

[Convert.ToBase64String(byte\[\])](http://msdn.microsoft.com/en-us/library/dhx0d524(v=vs.110).aspx)

This is rendered as:

Convert.ToBase64String(byte[])

See the demo comment below this answer as well.

Using backslashes is part of the Markdown standard, see Backslash Escapes:

Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown’s formatting syntax.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .