Hangs on Large Files w/ Fenced Code Blocks

Dallas Slieker's Avatar

Dallas Slieker

26 Jun, 2012 07:23 PM

Hi fletcher,

I have a properly formatted markdown document with 2497 lines. This is a technical document for an API with many, many code examples in fenced code blocks.

If I copy any single section into a file and attempt to render it, multimarkdown runs properly. However, with all of the lines together, marked hangs with 100% cpu.

It seems that there's an exponential increase in rendering time for each additional line added, and it seems to be because of MultiMarkdown.

While writing the document, sections would slow the renderer down as they got larger.

I chose marked only because of Table support and Fenced Code Blocks.

If I turn off Fenced Code Blocks, everything works as expected. I suspect it has something to do with syntax highlighting.

  1. Support Staff 1 Posted by Brett on 26 Jun, 2012 07:30 PM

    Brett's Avatar

    It's not MMD's fault, it's Marked's. The next version has this fixed, and I'd be happy to include you in a beta if you like.

    -Brett

  2. 2 Posted by Dallas J Slieke... on 28 Jun, 2012 04:29 AM

    Dallas J Slieker's Avatar

    That sounds great! Thanks Brett. For now, we are splitting our files into smaller blocks and using them to assemble multi-page html documentation with cross-linking.

    Works for now, but we're very interested in your beta!

  3. 3 Posted by Pierre on 05 Jul, 2012 12:01 PM

    Pierre's Avatar

    I have the same problem. Any idea of when the next version will be released? Interested in the beta too!

  4. Support Staff 4 Posted by Brett on 06 Jul, 2012 01:27 PM

    Brett's Avatar

    The next round of the beta should be out this week. I still have to finish sandboxing and there are new features which complicate that (VoodooPad and MarsEdit integration). I'll keep you posted. In the meantime if you do have a production-level issue with code block handling, I'm willing to add a few more people to the beta so you have a working solution. Contact me at http://brettterpstra.com/contact/ if needed.

  5. 5 Posted by dergachev on 30 Oct, 2012 12:00 AM

    dergachev's Avatar

    Hey I've got the same problem. Turning on fenced blocks makes Marked hang for 15 seconds or so each time I save the file, quite unbearable.

    File in question: https://github.com/dergachev/vagrant_redmine/blob/master/README.md

    I paid for the app just to get github rendering previews, so fenced blocks are a must. And because of this bug, my $5 is currently wasted. :(

    I can live without sytnax highlighting in Marked, but not github; perhaps there's a workaround until 1.5 ships?

  6. Support Staff 6 Posted by Brett on 30 Oct, 2012 12:05 AM

    Brett's Avatar

    You can set up a custom processor using any interpreter you want. If you have a markdown processor that can handle fenced code blocks, just add it as the custom processor. I believe Kramdown and Maruku will handle it, but there may be other differences from Github's (technically) proprietary syntax.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac