Tightening the rules for literal `[` and `]` chars in link ids

A. Pagaltzis pagaltzis at gmx.de
Mon Sep 25 15:39:19 EDT 2006


* John Gruber <gruber at fedora.net> [2006-09-25 21:15]:

> This change won't solve the problem for the magic implicit link

> references:

>

> The next line will disappear

> [like this]: here.

>

> One way to address this might be to tighten up the rules for

> what a URL is.


I doubt you can do that without undue restrictions. `here.` might
just as soon be a word as an actual relative link I want to use.

* John Gruber <gruber at fedora.net> [2006-09-25 21:25]:

> After a few more minutes of thought, I'm having a hard time

> coming up with a good reason why `[` and `]` shouldn't just be

> banned characters for link ref IDs.


That was my first thought after reading the previous mail. They
just make short link names harder to read.

However, I am using Markdown on a wiki where I currently
implement internal links simply by doing

[frobnicate the weeblefitzer]: /doc/42

where the link name is just the title of the page at `/doc/42`.
That way I get all the Markup linking features without for
intrawiki links without any effort [^1] – but there might well be
square brackets in it.

It is a rare enough case that requiring backslashes shouldn’t be
onerous, though. So that’s what I’d lean toward.


[^1]: Would that Markdown.pl had an API; then I could simply
`$mkd->add_link( $title => $href);` instead of the current
dirty hack of appending generated Markdown to documents.

Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>


More information about the Markdown-Discuss mailing list