1

While editing a [question on Ask Ubuntu] I noticed a bug:

> the link after [CMYK] [reference chart] is not displayed
[CMYK]:            https://en.wikipedia.org/wiki/CMYK_color_model
[reference chart]: https://en.wikipedia.org/wiki/Color_chart

is rendered:

the link after CMYK is not displayed


Edit     My wrong usage of markdown links is because the following works:

> Miswritten links are displayed anyway: [first] and [second]
[first]:  https://en.wikipedia.org/wiki/CMYK_color_model
[second]: https://en.wikipedia.org/wiki/Color_chart

is rendered:

Miswritten links are displayed anyway: first and second

1

Because you have not placed the link identifiers next to the link texts.
See the help center formatting ("Links" section) for markdown usage.

So in your case, you would fix it like this:

the link after [CMYK][CMYK] [reference chart][reference chart] is not displayed

[CMYK]: https://en.wikipedia.org/wiki/CMYK_color_model
[reference chart]: https://en.wikipedia.org/wiki/Color_chart

Outputs:

the link after CMYK reference chart is not displayed


You need the link text and the identifier together in separate brackets, then the identifier next to the link itself lower down the page.

For example:

the link after [CMYK][whatever_id_you_want] [reference chart][another_id] is not displayed

[whatever_id_you_want]: https://en.wikipedia.org/wiki/CMYK_color_model
[another_id]: https://en.wikipedia.org/wiki/Color_chart

Outputs:

the link after CMYK reference chart is not displayed


Although, if you're going to use the same ID as the link text itself (i.e. [CMYK][CMYK]) then just using a numerical ID reference is fine.
Such as [CMYK][1].

It's useful to use a unique identifier when it's a snippet (or different in some way) of longer text, for example:

[The first answer I am linking to][answer-1]
[The second answer I am linking to][answer-2]

Although how you use it is up to you, as long as it's used correctly :)

2

Your markdown is incorrect, as pointed out by James, however there is a shorthand syntax you can use to avoid typing the identifier twice:

This is a [link][] and [another][].

[link]: http://example.com/hello
[and another]: http://example.com/world

which is rendered as:

This is a link and another.

Additionally, if you only need to use the link once, I'd recommend this simpler method instead:

This is a [link](http://example.com).

This is a link.

You must log in to answer this question.

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