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


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


You need to escape one of the brackets.

byte[] test

byte\[] [test](http://google.com)

You must log in to answer this question.

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