无论何时我在HTML标签内使用Markdown,它都不会生成目录选项。例如:
我正在使用的命令行是:
#Test
##Test2
Hello there!
#Test3
##Test4
<div>
#hello
</div>
输出:
<nav id="TOC">
<ul>
<li><a href="#test">Test</a><ul>
<li><a href="#test2">Test2</a></li>
</ul></li>
<li><a href="#test3">Test3</a><ul>
<li><a href="#test4">Test4</a></li>
</ul></li>
</ul>
</nav>
<h1 id="test">Test</h1>
<h2 id="test2">Test2</h2>
<p>Hello there!</p>
<h1 id="test3">Test3</h1>
<h2 id="test4">Test4</h2>
<div>
<h1>hello</h1>
</div>
我正在使用的命令行是:
pandoc -f markdown -t html5 --toc -s test.md
是否可能在目录中包含嵌入HTML的Markdown?
standalone
选项或适当的模板时,Pandoc才会插入TOC。关于--standalone
和模板的描述可在Pandoc用户指南→模板中找到。这对你有帮助吗? - xmojmr