Possible to disable markdown within html parsing?

934 Views Asked by At

I'm using jekyll/gh-pages. Both Maruku and RDiscount are getting very confused with the following code:

<figure>
    <a id="fig-14"></a>
    <pre><code>
hashA = entityA._roId + ':' + entityB._roId;
hashB = entityB._roId + ':' + entityA._roId;

if( !checked[hashA] && !checked[hashB] ){

    // mark this pair as checked
    checked[hashA] = checked[hashB] = true;

    if( this.aabb2DIntersection( entityA, entityB ) ){
        pairs.push( [entityA, entityB] );
    }
}
    </code></pre>
    <figcaption>
        Fig. 14: Keeping a cache of tested pairs.
    </figcaption>
</figure>

Maruku is just completely failing to parse the block, while RDiscount uses figure as an html tag, but then thinks that everything inside is code because it's indented. I'm assuming this is because of support for parsing markdown within html blocks.

In either RDiscount or Maruku, is there a way to disable parsing within html blocks?

EDIT::

It turns out the error, at least in Maruku, is my fault. & and < need to be escaped, even in <code> elements. So while I still don't have an answer to this actual SO question, I do have an answer as to why maruku was having trouble with the block.

1

There are 1 best solutions below

0
On

Looks like this isn't possible yet with Maruku: https://github.com/bhollis/maruku/issues/57#issuecomment-9366049