inline link syntax question

Waylan Limberg waylan at gmail.com
Wed Sep 12 20:49:25 EDT 2012


On Wed, Sep 12, 2012 at 6:53 PM, John MacFarlane <jgm at berkeley.edu> wrote:

> I don't believe this question has been discussed before on

> this list: Should whitespace be allowed between the bracketed

> and parenthesized parts of an inline link?


I seem to recall authoring a few documents in which I expected some
text in parentheses following a shortened reference style link (no
second set of brackets) to trigger a inline link. However, the space
saved me. Sure I could have used two spaces, but I shouldn't have to.
Personally, its unclear to me why JG would have explicitly allowed the
space in reference style links. What useful purpose does it serve?

BTW, the shortened reference style links are not documented anywhere,
but clearly work in the latest version of markdown.pl. Here's an
example source paragraph:

Some text with a [link] (and some text in parentheses).

[link]: http://example.com

That should result in:

<p>Some text with a <a href="http://example.com">link</a> (and
some text in parentheses).</p>

As it does in markdown.pl and others. However, if the space is allowed
in inline links, then you get the incorrect output:

<p>Some text with a <a href="and some text in parentheses">link</a>.</p>

In contrast, I can't think of any situation in normal text where a
double set of brackets would appear except as a reference link.
Therefore a space is not harmful. Perhaps that is why JG allowed it
there.

I guess this is the long way of me saying Pandoc should stay the way
it is (which also means I get to leave Python-Markdown alone). In
fact, if I was going to suggest any change (for consistency) I would
say that we should disallow the space in reference style links. But
given the current wording of the syntax rules, I can't really see that
happening either.

PS: I like to use parentheses in my sentences (as you can see above -
and right here). I suppose others do not. For those people, this
wouldn't really matter so much. It does matter to those of us who use
them thought.

--
----
\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg


More information about the Markdown-Discuss mailing list