An idea for within document anchor references

John Gruber gruber at fedora.net
Sun Aug 21 23:03:09 EDT 2005


MDK <michaldominik at gmail.com> wrote on 8/21/05 at 6:26 PM:


> I miss this feature very much as well. But why don't we use a syntax like:

>

> [linked text][header]

>

> ...like we do with other links? If the link id ("header") matches any

> of the header names in the document it's automatically resolved.


Hmm. Interesting idea.

`[header]` is way too long though, and too wordy.

Off the top of my head:

[matches the text of a header][#]

might work.

The idea would be:

## This is a header ##

Blah blah blah.

...

Blah blah, see "[This is a header][#]" for more info.

And then in the markup, each header would get some sort of GUID id
attribute, and the magic [#] hookup would go to the first header in
the current article that matches the text of the link. So if you
have two "This is a header" headers, a `[This is a header][#]` link
would always point to the first one.

-J.G.


More information about the Markdown-Discuss mailing list