为什么用 Pandoc 创建的 RTF 文件会以纯文本形式打开?

Ash*_*Ash 6 word-processing markdown rtf text-formatting pandoc

我正在试验Pandoc,特别是降价到 RTF 功能。当我运行转换器时,生成的 RTF 在 Word 和 OpenOffice 中以纯文本形式打开(文本看起来像 RTF,但不被视为 RTF)。转换为 HTML 工作正常。

这是我使用的命令:

pandoc -f markdown -t rtf -o sample.rtf sample.txt
Run Code Online (Sandbox Code Playgroud)

这是我使用的简短示例降价:

# markdown example

- uli1

_em_

__strong__
Run Code Online (Sandbox Code Playgroud)

创建的文件内容的片段:

{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 markdown example\par}
Run Code Online (Sandbox Code Playgroud)

在 Vista 32 位上运行,使用 Pandoc 1.6(来自http://code.google.com/p/pandoc/downloads/list)。

有谁知道问题可能是什么?

小智 14

您只需要在调用 pandoc 时使用“-s”(或“--standalone”)选项。否则 pandoc 会生成一个片段,而不是完整的独立 RTF 文件。