0

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.

Andrew
  • 3,332
  • 4
  • 31
  • 37
  • Tried to add `markdown="0"` attribute? Not sure to which tag, try them all. As far as I know, this is part of [PHP Markdown Extra](http://michelf.ca/projects/php-markdown/extra/), Maruku claims that supports it, not sure about RDiscount. (I use [kramdown](http://http://kramdown.rubyforge.org/), that also supports it.) – manatwork Oct 01 '12 at 08:16
  • Thanks for the awesome suggestion, I didn't know about that attribute. I tried it on multiple elements: `figure`, `code`, `pre`... no effect with rdiscount or maruku. I'd use kramdown, but this is an article for an external site, where I don't have control over the markdown engine used. I'll probably just end up submitting generated HTML ([marked](https://github.com/chjj/marked) handles all of this fine for me). – Andrew Oct 01 '12 at 16:57
  • Turns out the issue was that I wasn't encoding `&` and `<` as I mentioned in my edit. That doesn't actually answer this question though! – Andrew Oct 01 '12 at 19:06

1 Answers1

0

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

Andrew
  • 3,332
  • 4
  • 31
  • 37