Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

The hyperlink markdown seems to break when you have "[] " immediately before link text. I noticed having spaces between the bracket groups doesn't effect the outcome. Maybe it should?

Source: byte[] [link][1]

Example: byte[] [link]1

share|improve this question
up vote 4 down vote accepted

You can fix this by properly putting your byte[] in code formatting. This will prevent the square brackets from being interpretted as a link. As to what is causing this problem, it's a lot of different parts of markdown colliding in a very unfortunate fashion as it tries to simply render in order. It happens in any scenario if you try to pre-empt a link with anything inside of a singular pair of square brackets, not just emptiness. The exact behavior you see is because the link text of your intended link is not a valid anchor.

First, specifying just the link footer anchor in brackets counts as a link. So if I have a link anchor of [2], then just writing [2] will count as a link, like below.


Second, adding a space between the link text and the link footer anchor is a legal action for markdown. So, [Elegance] [2] will render as just the same as if there was no space in the middle.


What's breaking in the end is that there's the secret point that link anchors don't need to be numbers. Markdown is treating your string byte[] [link][1] by linking the first set of brackets as link text, and the text "link" as the anchor. Then, 1 ends up being treated as its own separate link.

It still renders visibly because there is no "link" anchor at the bottom, so it is treated like a broken link syntax. Now, if you had an anchor of "link" at the bottom, though, you'll get the following output for your string:


You can't see anything, though, because there's nothing in the link text. But between the [1] and the byte is a link. Were I to add another anchor for 1, then it would render the 1 as a link as well as the emptiness. Since I don't, though, let's just see what [Elegance] [1][2] looks like.

[Elegance] [1]2

share|improve this answer
Thanks for the clarification, Grace. – Jeremy Heiler Feb 24 '11 at 14:23
This is absolutely correct; it relates to the fact that markdown allows a space between the two parts of the link definition. Hence, e.g., adding a second space before [link] would have worked as well. /cc @Jeremy – balpha Feb 24 '11 at 15:26

You need to escape one of the brackets.

byte[] test

byte\[] [test](

share|improve this answer

You must log in to answer this question.

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