Pandoc 从 markdown 到 docx 的转换,带有块引用和引用

Pandoc conversion from markdown to docx with blockquotes and citations

当我这样做时,我得到一个 docx,其中我的 markdown 块引号 (>) 没有被正确转换,但引文转换有效:

pandoc --filter pandoc-citeproc --bibliography ref/my-refs.bib in.md -o out.docx -f markdown

当我这样做时,块引用有效,但引文未转换:

pandoc --filter pandoc-citeproc --bibliography ref/my-refs.bib in.md -o out.docx -f markdown_strict

两者之间的唯一区别是markdown vs markdown_strict

我怎样才能使块引用 + 引用起作用?

这是由 blank_before_blockquote 扩展名引起的:

Extension: blank_before_blockquote

Standard Markdown syntax does not require a blank line before a block quote. Pandoc does require this (except, of course, at the beginning of the document). The reason for the requirement is that it is all too easy for a > to end up at the beginning of a line by accident (perhaps through line wrapping). So, unless the markdown_strict format is used, the following does not produce a nested block quote in pandoc:

> This is a block quote.
>> Nested.

您可以使用 -f markdown-blank_before_blockquote.

有选择地禁用此扩展程序