"Lazy" Markdown reference links

Garth Kidd's Avatar

Garth Kidd

11 Nov, 2013 12:48 AM

I've been using this syntax for most of my links:

You should follow [this link].

[this link]: http://example.com

That's like the implicit link syntax, but even more implicit. It works on every renderer I've tried. I can't find it documented anywhere, though: not even your cheat sheet has it. It's been noticed before, though.

More recently, Chairman Gruber cited a Terpstration on an even more compact syntax:

You should follow [this link][*], and also [this one][*]

[*]: http://daringfireball.net/projects/markdown/syntax
[*]: https://rawgithub.com/fletcher/human-markdown-reference/master/index.html

MultiMarkdown Composer breaks on this in two ways. One is that it only ever uses the last definition of the * target for all links with that target. The other is related to your handling of italic text:

My [favicon][*] is full of *eels*.

[*]: http://en.wikipedia.org/wiki/Favicon

Your support site preview window gets my intent. The MMC 2.5.3 (37) composer window and preview window don't.

  1. Support Staff 1 Posted by Fletcher on 11 Nov, 2013 12:54 AM

    Fletcher's Avatar

    This is a standard Markdown link, which is why it works:

    You should follow [this link].
    
    [this link]: http://example.com
    

    This is not Markdown, or MultiMarkdown, which is why it doesn't work:

    You should follow [this link][*], and also [this one][*]
    
    [*]: http://daringfireball.net/projects/markdown/syntax
    [*]: https://rawgithub.com/fletcher/human-markdown-reference/master/index.html
    

    I think this syntax is a horrible idea --- rearranging a sentence could result in switching two links inadvertently; it's very difficult to visual "error check" when all the links are the same.

    If this were to become part of Markdown, I would probably have to support it in MultiMarkdown. But I don't intend on adding it to MultiMarkdown short of that. And since Gruber hasn't updated Markdown in years, that's pretty unlikely.

  2. Fletcher closed this discussion on 11 Nov, 2013 12:54 AM.

  3. Fletcher re-opened this discussion on 11 Nov, 2013 01:08 AM

  4. Support Staff 2 Posted by Fletcher on 11 Nov, 2013 01:08 AM

    Fletcher's Avatar

    I realized that my wording may have been a bit strong.

    I stand by my opinion that this syntax is not a good idea, but I recognize that some people may like it.

    But it makes the document much less readable to a human -- you have to count links in order to know which link is which. It's easy enough with one or two, but much beyond that and it would increase the likelihood of a reader misinterpreting the document.

    I think it's the wrong solution to the wrong problem. The problem is not needing to type each link using `[*]`, the problem is wanting a faster way to insert reference style links.

    This is not the best solution to that problem, and it creates additional downstream issues.

  5. Fletcher closed this discussion on 15 Nov, 2013 04:03 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac