camino
camino

Reputation: 10574

Is it possible to give anchor an alias in markdown?

I am wondering if it is possible to give anchor an alias name.

for example:

## a very looooooooooooooooooooooooooong string

How can I refer to the long anchor with a short alais?

Upvotes: 1

Views: 1470

Answers (2)

Waylan
Waylan

Reputation: 42467

You can revert back to raw HTML:

<h2 id="short-string">a very looooooooooooooooooooooooooong string</h2>

And then you can link to it elsewhere with:

Link to [a very looooooooooooooooooooooooooong string](#short-string).

Upvotes: 3

Marc
Marc

Reputation: 2410

Yes, it is possible, at least in the popular R markdown version (aka. Pandoc's markdown)

Not sure which flavour of markdown you are using but I did use this specific feature in several of my past R-markdown reports in the past.

Referring to the RStudio markdown cheatsheet v2.0:

# Header1 {#anchor}

then

Jump to [Header 1](#anchor)

Upvotes: 1

Related Questions