Markersdown: I was fooling around with lua and decided to write a markdown parser using the terrific lpeg library. Here's the result: http://github.com/jgm/lunamark/tree/master There are already two markdown libraries for lua, one a native lua implementation based on global substitutions, the other a binding to discount. What makes lunamark different is that it is based on a PEG grammar (adapted from my peg-markdown). This can be found in the file lunamark/markdown_parser.lua in the source tree. Lunamark converts standard markdown to HTML and LaTeX. Adding a new output format is easy (the LaTeX writer took about 20 minutes to add). It is also possible to add new input formats. Lunamark passes the Markdown 1.0.3 test suite (except for one edge case involving loose/tight lists, and here its behavior is consistent with the markdown syntax description -- see the README for peg-markdown for discussion). As for performance, lunamark is about the same speed as PHP Markdown in my tests. John
> As for performance, lunamark is about the same speed as PHP Markdown in > my tests.Is this with or without counting the time necessary to read the input? On my test, reading a wiki page of 500 words _once_ and then converting it 1000 times, lunamark is actually about 2.5 times faster than PHP Markdown. But perhaps a comparison with the other two Lua options is more relevant. On the same benchmark, lunamark is 5-6 times faster than markdown.lua and 12-13 times slower than lua-discount. (Of course, lua-discount is basically a binding to a C implementation.) - yuri