【问题标题】:Stop pandoc adding id automatically停止 pandoc 自动添加 id
【发布时间】:2017-09-28 18:11:41
【问题描述】:

我正在使用Pandoc's extention of markdown 来生成 HTML。

以下降价:

#test{#specificId}
##test2
###test3

生成以下 html

<h1 id="specificId">test</h1>
<h2 id="test2">test2</h2>
<h3 id="test3">test3</h3>

理想情况下,它会产生这样的结果:

<h1 id="specificId">test</h1>
<h2>test2</h2>
<h3>test3</h3>

我无法在文档中找到一个选项,如果它被显式添加到降价中,输出只会添加一个 ID,尽管我真的不知道要搜索什么。

提前感谢您的帮助。

【问题讨论】:

    标签: html markdown pandoc


    【解决方案1】:

    我找到了答案。

    “功能”称为auto_identifiers。可以通过将-f markdown更改为-f markdown-auto_identifiers在命令中禁用它

    希望这对其他人有所帮助。

    【讨论】:

    • 谢谢,乔纳森。您是否有机会详细说明您在哪里进行此更改?
    • @BryanMichael 同时调用它:pandoc -f markdown-auto_identifiers -t html -o foo.html foo.md,其中-f--from 的简写。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-25
    • 2021-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多