【问题标题】:How can I alter the formatting of pandoc footnote marks?如何更改 pandoc 脚注标记的格式?
【发布时间】:2016-10-24 19:45:15
【问题描述】:

假设我有以下降价代码,test.md:

This is a footnote mark.^[Which I would like to show up having brackets]

然后我使用以下命令生成 HTML:

$ pandoc --ascii test.md -o test.html

这给了我以下 HTML:

<p>This is a footnote mark.<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a></p>
<div class="footnotes">
<hr />
<ol>
<li id="fn1"><p>Which I would like to show up having brackets<a href="#fnref1">&#8617;</a></p></li>
</ol>
</div>

其中的突出部分显示为:

这是一个脚注标记。1

我想要的是某种方式来获得维基百科风格的上标链接,如下所示:

这是一个脚注标记。[1]

有没有办法做到这一点?我想不通,没有用 lua 写我自己的作家。

【问题讨论】:

    标签: html markdown pandoc


    【解决方案1】:

    您可以使用 CSS 为生成的 HTML 脚注设置样式:

    .footnoteRef sup:before {
      content: '[';
    }
    .footnoteRef sup:after {
      content: ']';
    }
    &lt;p&gt;This is a footnote mark.&lt;a href="#fn1" class="footnoteRef" id="fnref1"&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;

    【讨论】:

      猜你喜欢
      • 2019-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-06
      • 2016-09-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多