Code snippets not being rendered properly

Nick DeSteffen's Avatar

Nick DeSteffen

14 Feb, 2012 01:31 AM

I'm trying to use Marked to read this book:
https://github.com/addyosmani/backbone-fundamentals/blob/master/REA...

The code examples aren't rendered properly, this makes it rather difficult to use Marked.

Thanks,
Nick

  1. Support Staff 1 Posted by Brett on 14 Feb, 2012 01:50 AM

    Brett's Avatar

    Those code snippets are built using fenced code blocks, which MultiMarkdown does not understand. While future versions may support this, code blocks currently need to be entered in blocks indented by 4 spaces or a tab, or within backticks for single line snippets. I cannot currently support code fencing within Marked.

    The easy solution is to save the raw file and run a regex to convert fenced code blocks to tab-indented ones. Even easier, use Gather to convert the page to more workable MultiMarkdown automatically. I'm attempting to attach an example output to this message, if it fails I'll add one in a moment.

    -Brett

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