Flexible Markdown Parser
Michel Fortin
michel.fortin at michelf.ca
Sun Sep 14 07:14:06 EDT 2014
Le 14-sept.-2014 à 6:34, Andrei Fangli <andrei_fangli at hotmail.com> a écrit :
> Hello again,
>
> I’m happy to announce that I have a working parser fully based on regex and a default implementation for Markdown based on Gruber’s Markdown 1.0.1 (Dec 2004) specification. The only thing I could not figure out is the blank line between list items to generate a paragraph in the list item instead of plain text (that is very ambiguous to me and sounds a bit odd) and instead I decided that all list items cannot contain plain text (a very simple approach, I know).
The rule used in Markdown.pl is that if there is a blank line separating two list items, both the item above and the item below that blank line will be parsed as block content (and have paragraphs). That said, sublists are parsed anyway regardless of blank lines.
> A preview site is up and running: http://www.markdownparser.development.andrei15193.ro/
>
> Critics and comments are welcomed.
>
> PS: can someone point me to some test suites you use? I would like more test cases (the ones I wrote are really rudimentary). Also big documents for performance testing would be nice.
You can use [MDTest][1] which includes the original MarkdownTest test suite from John Gruber as well as my own test suite for PHP Markdown and PHP Markdown Extra.
[MDTest]: https://github.com/michelf/MDTest
--
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca
More information about the Markdown-Discuss
mailing list