[ANN] Markdown.pl 1.0.2b4

Michel Fortin michel.fortin at michelf.com
Mon Sep 19 10:15:28 EDT 2005


I can't download that file. It says 403 Forbidden. But this link
works okay:
<http://daringfireball.net/projects/downloads/Markdown_1.0.2b4.tar.gz>

- - -

Le 2005-09-19 à 02:16, John Gruber a écrit :


> 1.0.2b4 - Thu 08 Sep 2005

>

> + Filthy hack to support markdown='1' in div tags, because I

> need it

> to write today's fireball.

>

> + First crack at a new, smarter, block-level HTML parser.

> This now

> passes the "Inline HTML (Advanced)" test.

>

> This new parser requires Damian Conway's `Text::Balanced` Perl

> module, which is standard with Perl 5.8.0 and later. Thus the

> algorithm here is going to fork from Michel Fortin's PHP port,

> but, fortunately for Fortin, his PHP code already passes these

> tests.


Great! This is interesting. Okay, this gives me two choices. I'm not
sure exactly which one is the best:

1. The simple one: just put the HTML block parser of PHP Markdown Extra
into PHP Markdown. That would be quite easy.

2. Take some time to ensure it produce the same result as your, so
that everything written for PHP Markdown is mostly guarantied to
work with [Perl] Markdown too.

I think it all depends on the future Markdown spec. I already have a
version of PHP Markdown which is "beyond specs", I want PHP Markdown
to follow them more closely. In fact, this is the whole purpose of
PHP Markdown *Extra*, keeping *extras* in a separate branch, keeping
plain PHP Markdown in sync with the Markdown specification so people
can choose between compatibility or features.

My question: What is the spec going to say about the limitations of
this?

- - -

John, I see you take a somewhat different approach than me with your
`markdown="1"` "hack". Your method accept multiple different link
references which are mostly confined to their enclosing `<div>`. Here
is an example:

[link][a]

<div markdown="1">
[link][a]
[a]: somewhere
</div>

<div markdown="1">
[link][a]
[a]: somewhere-else
</div>

<div markdown="1">
[link][a]
</div>

[link][a]

Which produce this:

<p>[link][a]</p>

<div>
<p><a href="somewhere">link</a></p>
</div>

<div>
<p><a href="somewhere-else">link</a></p>
</div>

<div>
<p><a href="somewhere-else">link</a></p>
</div>

<p>[link][a]</p>

As you can see, the "a" reference means two things depending on the
context. I said "**mostly** confined to their enclosing `<div>`"
because of the third `<div>` in my example still accept a reference
from the preceding one. (Note: link references defined outside
`<div>` sections do work as expected inside them, that is, unless you
also defined it in a preceding `<div>` like in the above example.)

My question: What parts of this are desired and should be ported to
my PHP block parser? ... if any.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/




More information about the Markdown-Discuss mailing list