我正在使用 jekyll/gh-pages。Maruku 和 RDiscount 都对以下代码感到非常困惑:
<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 只是完全无法解析块,而 RDiscountfigure
用作 html 标记,但随后认为里面的所有内容都是代码,因为它是缩进的。我假设这是因为支持在 html 块中解析 markdown。
在 RDiscount 或 Maruku 中,有没有办法在 html 块中禁用解析?
编辑::
事实证明,至少在 Maruku 中,错误是我的错。&
并且<
需要被转义,即使在<code>
元素中也是如此。因此,虽然我仍然无法回答这个实际的 SO 问题,但我确实可以回答为什么 maruku 遇到问题。