xMarkdown implementation
John Gruber
gruber at fedora.net
Mon Mar 29 14:04:53 EST 2004
european bob <bob at wolfwall.com> wrote on 03/29/04 at 5:30p:
> <http://www.alcoholicsunanimous.com/xmarkdown/xMarkdown-current.tar.bz2>
> (19k)
>
> .... with some further explanation about why I wrote it (though 50% of
> the answer is 'because I wanted to', really) and why and how it is
> different to the daringfireball.net implementation in the root of that
> directory.
Bob, this is just terrific. Wonderful stuff. I simply don't have
time at the moment to really dig in to what you've done, but at
first glance, I'm both impressed and delighted.
One quick comment from the readme:
> Since Markdown does not specify the version of HTML to fall back on,
> the following is valid Markdown:
>
> <ul>
> <li class="nav">Home
> <li class="nav">Links
> <li class="nav">Email me
> </ul>
>
> Since the above is not well-formed XML, we cannot pass it straight
> through in xMarkdown. Instead, it attempts to parse the HTML and
> correct it if necessary.
This is totally true, that Markdown does not specify any sort of
requirements for what kind of raw HTML you're allowed to include,
inline, in your Markdown-formatted text. For pathological cases,
such as your above example of ancient unclosed HTML tags, this could
be remedied by stating that Markdown requires inline HTML to be HTML
4.01 or later.
But even that falls short of addressing the issue, because what
happens when you want to include an empty element tag, e.g., a br
tag with a custom class. One might use either of:
<br class='foo'>
<br class='foo />
One is HTML 4, the other XHTML. Markdown puts the responsibility for
doing this correctly on the writer's shoulders.
I doubt I'll change this for Markdown proper -- and I assume you
agree that I'm correct to do so. Your new valid XHTML-only
implementation is a terrific idea.
> I hope people find a separate codebase kind of interesting, anyway, not
> least from a pathalogical point of view ;)
I certainly do. I hope you're willing to keep your implementation up
to date with the handful of additions I have planned going forward.
Thanks. More comments to come after I get a chance to do more than
kick the tires.
-J.G.
More information about the Markdown-discuss
mailing list