Maruku错误地解析了第二行代码块?
|
我正在使用Maruku(Ruby)解析一些Markdown格式的文本。尝试像这样格式化“ 0”块时遇到问题:
This is a normal line
# pretend this line is empty
printf(\"First line of code is OK\");
printf(\"Second line of code (or any line thereafter) appears indented by an extra level, which is incorrect!\");
所以我的第一行代码(我在md文件中缩进了4个空格(或一个制表符),就像我期望的那样呈现。但是,我的第二行代码(缩进了相同数量的空格)最终会在生成HTML时缩进4个空格。
输出看起来像这样:
This is a normal line
<pre><code>printf(\"First line of code is OK\");
printf(\"Second line of code (or any line thereafter) appears indented by an extra level, which is incorrect!\");</code></pre>
我已经使用Gruber的\“ Dingus \”测试了我的Markdown输入,它按照我的期望进行渲染(也就是说,两行代码在一个块中,都在同一级别缩进)。但是有了Maruku,这真是铺张了床。
我也尝试过使用RDiscount,但效果相同。我使用Maruku是因为我需要定义列表。
SO如何格式化:
这是一条正常线
printf(\"First line of code is OK\\n\");
printf(\"Second line of code (or any line thereafter) appears indented by an extra level, which is incorrect!\");
没有找到相关结果
已邀请:
1 个回复
茶鬼失形
。 例如,给定
:
和
然后它将为我正确呈现。