New link syntax

european bob bob at wolfwall.com
Wed Mar 31 16:27:51 EST 2004


On Wed, 2004-03-31 at 22:00, John Gruber wrote:
> I agree that we're on the same page, thinking in the same direction. 
> But you did write this:
> 
> > <snip rubbish idea>
> 
> and I think the output stream is always going to be the wrong place
> to put errors/warnings.

Oh, sure, that's a valid point. 

> > Markdown is in exactly the same position. Possibly what you mean is that
> > in some situations (ie., the web) it's more difficult to plug the
> > compiler into the IDE?
> 
> It's probably a bad analogy on my part. It doesn't really hold up at
> all when you think about the way Markdown is invoked for Movable
> Type and Blosxom users, for example. No one sane is using gcc from
> the other side of a textarea field in a browser.

Yeah, exactly - the argument is really a different about the round-trip
between the browser and the server, and how that usually doesn't work
well for anything which ought to be interactive. I don't think we
fundamentally disagree about any of this.

> Actually, I think a Markdown checker could be rather easily written
> *in* JavaScript. Especially since the things that need checking are
> rather easily detected.

With the example of []-ish links (which I know, for example, that
xMarkdown definitely gets wrong in some circumstances currently, and I
think Markdown possibly also gets wrong) - Markdown uses a (??: regex to
pull them out. Can you do that in Javascript? I know a little
Javascript, but I didn't think the regex stuff was that powerful (given
PCRE-implementations tend not to implement things that require you to
implement Perl ;). The PHP port that is existant doesn't deal with that
either (although I don't think it deals with it sufficiently badly for
it to be any sort of practical issue).

Personally, I would probably be a bit pro-re-analysing the link
situation. Lou makes some good points which I haven't really thought
properly about, but (for example) you shouldn't need to have a balancing
algorithm to get the links right (because that is known to be impossible
to implement with pure regexes, for a start ;). If the regex could be
tightened to, say, /\[.*?\]\s?\[[\^\]]+]/ (and I'm not sure it can, but
as an example) then it does begin to make things simpler. 

One thing that worries me about implicit links is ambiguity - what is
[this] [link] for example? <a href="[link]">this</a>, or <a
href="[this]">this</a> <a href="[link]">link</a> ? Maybe implicit links
should be rather more [[different]]. Or look kind-of [linkish]->. Or
something. Heh, maybe we could have _links_ ;) Either way, I think there
is probably some need for rule-tightening before moving much further
forward or altering the syntax.

(All of this may be irrelevant corner-case chasing though; which is
usually an activity I disapprove of ;)

--bob.



More information about the Markdown-discuss mailing list