A reminder of the original design goal of Markdown - my personal thoughts

John Gruber gruber at fedora.net
Mon Sep 5 16:29:45 EDT 2005


Fletcher T. Penney <fletcher at alumni.duke.edu> wrote on 9/5/05 at 2:51 PM:


> > Well, we could argue that what is really necessary is a way to link

> > to headers, not to set manually the id attribute of each one. But

> > there is many reasons to not want automatic id generation: What

> > happen to internal links if you change slightly the name of one

> > header? Will adding a new section in the middle of the document

> > break outside links to other headers? These two problems cannot

> > appear if you set your own id and do not change them.

>

> At some point, you have to say "This document is too complicated for

> Markdown... Time for me to handcode it, or use another tool."


Having more than one same-level heading with the same text is not
complicated. The problem with automatic id generation is that id
attributes must be unique. What happens if you have input like this:

# GoodFellas
## Rating
5 stars

# Mean Streets
## Rating
4 stars

How would Markdown assign unique id's to both "Rating" h2 headers?

And it's not just for headers within the same article. What happens if
the above are two different posts but which are shown on the same index
page of a weblog. The headers still need to be unique.

If we put the onus on the author to generate the id's, there's still no
guarantee of uniqueness, but at least the responsibility is theirs.

-J.G.


More information about the Markdown-Discuss mailing list