does fireball markdown support anchor links?
Alan Hogan
contact at alanhogan.com
Thu Jul 9 00:30:28 EDT 2015
On Wed, Jul 8, 2015, at 08:38 PM, David Chambers wrote:
> GitHub's solution isn't ideal, as automatically generated fragment
> identifiers are rather ugly in some cases.
Totally agree, David.
Furthermore, auto-gen'd headers *will* break when the text of the header
is changed, which can be done for any number of innocuous reasons when
we would like the link to be preserved. (Cool URIs don’t change, right?)
For that reason, I have always been a fan of the ID specification
syntax that pandoc, PHP Markdown Extra, maruku, kramdown, and a few
others support:
## This is a header {#a-header}
which compiles to:
<h2 id="a-header">This is a header</h2>
Look at that! Cleaner Markdown *and* cleaner output than inserting your
own <a> tag. And better, more future-proof section IDs than the auto-
generated variety.
Sadly, I never get to use it, due to the regrettable and totally
predictable fact that so many Markdown converters ignore it.
Not to pick on showdown, but look at its output: <h2
id="thisisaheaderaheader">This is a header {#a-header}</h2>
Compare output of my example above on Babelmark2:
http://ajh.us/babelmark2-header-id-syntax
--
Alan Hogan
contact at alanhogan.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist6.pair.net/pipermail/markdown-discuss/attachments/20150708/2507d261/attachment-0001.html>
More information about the Markdown-Discuss
mailing list