Update on MultiMarkdown 4.0

46 views
Skip to first unread message

flet...@fletcherpenney.net

unread,
Apr 22, 2013, 12:17:49 PM4/22/13
to

Update on MultiMarkdown 4.0

04/22/2013 07:31:28

I’ve been hard at work nights/weekends to rewrite MultiMarkdown, and am making fantastic progress!

The new version now passes all of the Markdown/MultiMarkdown/Compatibility tests for HTML that are expected (there is one Markdown test that peg-markdown fails, and therefore MMD fails as well. This is really an edge case, and arguably John MacFarlane’s approach is the better one here.) During the testing, I found one or two small things that I actually changed — this means that 4.0 won’t be character for character identical to 3.7, but I believe all the changes are for the better and should have minimal, if any, impact on most users.

Performance is actually better than MMD (aka peg-multimarkdown) 3.7 right now, but I still need to add the “deadman’s switch” to keep things from running amok forever on bad documents (this will slow things down some). I was worried that my new code would lose some efficiency over John’s peg-markdown work, but I managed to simplify some things that improved overall performance. It’s still slower than peg-markdown, but this is expected as it has more features.

During my tests, there are still no memory leaks. This should be a tremendous help for MultiMarkdown Composer.

I’ve added a bit more safety checking to help prevent crashes with “unusual” documents that don’t fit expectations.

More importantly, the code should be reentrant/thread-safe. This means that the commands can be called multiple times in multiple threads without “colliding” with each other. These collisions can lead to crashes that are difficult to track down as it is unlikely that two threads will collide in exactly the same way on multiple runs. I have not tested this aspect of the code yet, but that will be coming up in the next phase.

As mentioned, HTML functionality is basically complete. Adding in LaTeX, OPML, FODT support will now be relatively easy since the framework is complete.

I still have a few command line options/commands to add back in, but these should be fairly straightforward.

Once I get these features added in, I’ll upload the source to github and get some more eyeballs looking for bugs. 4.0 will basically be a feature match release for 3.7. Once all the kinks are worked out, I’ll start considering new features and updates.

For those who are interested:

  • The code is still C, and should be compatible across hardware/OS combinations
  • It uses a PEG definition that is almost the same as that used by peg-multimarkdown — the C code that handles the parsing, however, is quite different.
  • It uses [greg] instead of [peg-leg] to parse the grammar file. Later versions of peg-leg can supposedly make reentrant parsers, but greg opens up a few other features I hope to take advantage of.
  • I rewrote the Makefile. This means that there may need to be some changes for other hardware/OS types. Let me know what I need to do if you find a problem.
  • The structure of the code/header files should be a little bit more sane — peg-markdown seemed strangely configured, and I didn’t improve it when I forked to peg-multimarkdown. This should make it easier to include in other projects.

Limitations:

  • peg-markdown, and therefore MultiMarkdown use a true parser to analyze text documents for conversion to HTML, instead of regular expressions. This allows for improved accuracy, and generally excellent performance. However, in certain cases the parser can get bogged down by unusual document structures (e.g. nested HTML). Most, but not all, of these have been fixed over the years (mostly by John MacFarlane), but there are still some specific documents that just don’t play well with MMD and peg-markdown. If you stumble across this, send me the document and I’ll take a look.

http://fletcherpenney.net/2013/04/mmd4_update.html

Fletcher T. Penney

unread,
Apr 23, 2013, 11:22:50 AM4/23/13
to David Favor, multim...@googlegroups.com
It's not available yet. I want to get all the basics complete, so there aren't a flood of "bug reports" telling me it's not finished. People have a tendency to not read the directions.... ;)

But, when it's ready it will be a new github project since the new code is pretty much a complete rewrite from the old version.

When it's ready, I'll announce it via my web site, twitter, and the discussion list. HTML passes all the tests. LaTeX still misses one or two things in the Sanity tests. Memoir and Beamer are basically working. Need to add OPML and ODF still, plus a few of the extra command line options. Probably another week or two to polish things up, though I may post it before then.

F-


On Apr 23, 2013, at 11:07 AM, David Favor <david...@gmail.com> wrote:

> To access V4 work, is git https://github.com/fletcher/peg-multimarkdown still correct?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups "MultiMarkdown Discussion List" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to multimarkdow...@googlegroups.com.
> To post to this group, send email to multim...@googlegroups.com.
> Visit this group at http://groups.google.com/group/multimarkdown?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


--
Fletcher T. Penney
flet...@fletcherpenney.net

David Favor

unread,
Apr 23, 2013, 11:24:52 AM4/23/13
to multim...@googlegroups.com
Hum...

git clone https://github.com/fletcher/peg-multimarkdown multi-mark-down.git

git describe shows 3.7.1-2-g0d9c20e ... so maybe the correct branch is origin/development

Pass along the suggested syntax to clone the 4.0 tree.

Thanks.

David Favor

unread,
Apr 23, 2013, 12:44:13 PM4/23/13
to multim...@googlegroups.com, David Favor
Perfect.

Thanks.
Reply all
Reply to author
Forward
0 new messages