Closed trans closed 10 years ago
I'm not sure I follow what you're suggesting here. What's wrong with the current approach, and how is it fundamentally different than what you're suggesting?
Currently it renders to just:
<h1><a href="#something">Something</a></h1>
Which is rather useless because without the id
attribute entering the url http://foo.com#something
will not take us to the anchor.
Note, I've read examples where name
is used instead of id
, but the a
tag (nor the h*
tags) appear to support the name
attribute any more. So I think id
is the best choice even though browsers seem to support both.
Also, id
could be put on the h1
instead:
<h1 id="something"><a href="#something">Something</a></h1>
It should work just as well either way. But I suspect it is easier to add it to the a
tag in implementation.
Not sure what you're doing, but it renders this:
<h1 id="something"><a href="#something">Something</a></h1>
Oh nice! Sorry, I was running it through the wrong parser (github's) and thought it would be the same --MultiMarkdown is first parser I have seen that does this right! :+1:
Another issue bits the dust!
GitHub doesn't use MultiMarkdown.
Header's that are links that only provide "hash tags" for their URL, should also add an id to the rendering of the tag.
becomes
This allows document anchors to work properly.