New link syntax

european bob bob at wolfwall.com
Wed Mar 31 03:41:47 EST 2004


On Wed, 2004-03-31 at 02:38, Lou Quillio wrote:
> On the subject of hacks, I wonder if MD shouldn't abstract the various 
> delimiters into an easily-editable lookup array.  Easier to tinker, and 
> might solve some localization issues later.  Don't see it in the 
> source, but I'm way out of my Perl depth.

If you're talking about storing the second-bracket references (i.e.,
[][this bit]), xMarkdown functions that way (I'm not sure how Markdown
does it). From reading the spec, I've always treated the link-nickname
definition as global to the whole document, and the links are only put
in place as the final step. That would make me sort-of against Aaron's
proposal on the basis that the resolution algo would be extremely hard
to implement, and potentially ambiguous. 

I do like the proposed link syntax, [this works for me] quite well.
There is greater potential for clash to the new user I think (this is a
great site! [Click here!] etc.) though. This brings me to a slightly
separate question: could/should a Markdown interpreter generate errors,
and how should they be passed to the user? For example, if I wrote
[Click here!] again it's kind of obvious that I'm redefining something.
Unless you want localised-links (which I don't; because the meaning of
the document changes if you cut'n'paste during editing) then that has to
be wrong and you should be telling the user about it (the alternative
seems to me to force the user to check every link is as they thought it
would be). My current preference is to include the error in the output,
something like:

<div class="error" style="display: none;">
	<p>You fool, you defined &quot;Click here!&quot; as a link twice</p>
</div>

.. since it's basically not there, but you could use CSS to bring it up
on a development site. Or perhaps you would have a switch to turn it on
and off, defaulting to off. (This also begs a separate question; is
there such a thing as a Markdown validator? My heart says no, but my
head says maybe..)

--bob.



More information about the Markdown-discuss mailing list