Parsing Code Blocks

Michel Fortin michel.fortin at michelf.com
Thu May 15 23:58:38 EDT 2008


I've rewritten the code block grammar in the Markdown Extra [spec][]
to match what Markdown.pl and PHP Markdown do. It should now handle
things such as this:

~~~
> One
Two

> Three
Four

Five
~~~

as one blockquote containing only one code block with five lines,
equivalent to this one (using fenced code blocks instead for clarity):

~~~
> One
> Two
>
> Three
> Four

Five
~~~

I'm wondering though if code blocks shouldn't force a "non-lazy"
syntax, which would mean yielding a result identical to this instead:

~~~
> One

Two

> Three

Four

Five
~~~

Thoughts?


[spec]: <http://michelf.com/specs/markdown-extra/#block-element-generator
>


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




More information about the Markdown-Discuss mailing list