Markdown patch for link id bug

Frank Hecker December 25, 2004
Source

UPDATE 2023-03-27: This page is obsolete, as it refers to a prior version of this blog. However, it may be of historical interest.

In using Markdown I found one problem, one I’m surprised hasn’t been reported before. (I looked through the Markdown mailing list archive briefly, but didn’t see anything on this; perhaps people consider the current behavior a feature, not a bug?)

I make extensive (really, almost exclusive) use of reference-style links, and noticed problems when I word-wrapped my paragraphs, so that the resulting text looked something like the following:

In both the above cases Markdown 1.0 doesn’t recognize the presence of a link.

The fix is pretty simple (I think): Just convert newlines in the link id to spaces before checking to see if a given link id has been defined; see my Markdown 1.0 patch for the diffs from Markdown 1.0. Note that the bug is still present in the Markdown 1.0.1 release, so I’ve made a Markdown 1.0.1 patch available as well.

Discussion in the ATmosphere

Loading comments...