tags:

views:

215

answers:

1

If I have some Markdown like

## My Title

A paragraph of content here.

    code_line(1);
    // a code comment
    class MoreCode { }

and more text to follow...

How can I set a class on the <code> block that's generated in the middle there? I want to have it output

<code class=’prettyprint’>
  code_line(1);
  // a code comment
  class More Code { }
</code>

But I can't seem to set it. I do not have control over the Markdown code being run, only over the content.

+6  A: 

You can embed HTML in Markdown. Just type literally what you want, with no indent.

<code class="prettyprint">
  code_line(1);
  // a code comment
  class More Code { }
</code>
Patrick McElhaney
Alas, I suspected this was the only option. Glad to have some confirmation.
James A. Rosen