Fenced-Code-Blocks in Python-Markdown

Waylan Limberg waylan at gmail.com
Mon May 12 09:02:49 EDT 2008


On Mon, May 12, 2008 at 7:16 AM, Michel Fortin
<michel.fortin at michelf.com> wrote:

> Le 2008-05-12 à 1:01, Waylan Limberg a écrit :

>

>

>

> > I'd like to announce a beta release of the Fenced-Code-Blocks

> > Extension for Python-Markdown.

> >

> > <http://www.freewisdom.org/projects/python-markdown/Available_Extensions>

> >

>

> Wow, that was fast! :-)


Thanks. Python-Markdown's extension API made is easy. Wasn't much more
than getting the regex put together (due to differences in regex
implementations, I couldn't just copy your PHP regex).


>

> There is one particularity in my implementation I think you've missed

> though (which is not surprising given I haven't mentioned it anywhere, yet).

> It touches the output when there are leading blank lines.


Actually, I did see that in testing your implementation, but wasn't
sure exactly why you were doing it. I meant to come back to it later
and forgot about it. Shouldn't be to hard to add though. Your notes
will no doubt be helpful.

[snip]

>

> While it has been suggested some time ago that {.class-name} stand for a

> class attribute applied to an arbitrary element, I'm wondering if we can't

> do something better than that for code blocks.

>

> I'm currently thinking of allowing the following, which I find more

> appealing visually:

>

> ~~~~~~~~~~~~~~ .html

> <p>Hello World!</p>

> ~~~~~~~~~~~~~~

>


Actually, I had done it that way first. Then I went back and reviewed
the previous discussions. Interestingly, I had originally made the
case for having the label on the top, rather than the bottom. But
after further thinking, I realized that my current implementation is
consistent with the HeaderID syntax. Given the number of complaints
we've been getting on the list recently about styling inconsistencies
in the syntax, I figured that made for a stronger argument so I used
curly brackets at the end. If the consensus is on something different,
I can work with it.



--
----
Waylan Limberg
waylan at gmail.com


More information about the Markdown-Discuss mailing list