以http://kramdown.rubyforge.org/syntax.html#footnotes中的示例为例,我在IRB中运行以下代码:
Kramdown::Document.new('This is some text.[^1]. Other text.[^footnote].').to_html它返回:
"<p>This is some text.[^1]. Other text.[^footnote].</p>\n"这似乎表明在Kramdown中默认禁用脚注。如何启用它们?我已经查看了options documentation,但我没有看到在那里列出的启用/禁用脚注的选项。
发布于 2013-02-22 04:57:36
从docs you link to
如果找到标识符的脚注定义,则将创建脚注。否则,脚注标记不会转换为脚注链接。
因此,您需要包括脚注定义,例如(在文档页面下方有一个更完整的示例):
This is some text.[^1]. Other text.[^footnote].
[^1]:A footnote.这会产生以下结果:
<p>This is some text.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>. Other text.[^footnote].</p>
<div class="footnotes">
<ol>
<li id="fn:1">
<p>A footnote.<a href="#fnref:1" rel="reference">↩</a></p>
</li>
</ol>
</div>请注意,由于定义了[^1],因此生成了它的脚注,但[^footnote]保持原样。
https://stackoverflow.com/questions/15011695
复制相似问题