HTML 的 Pandoc docx 在 <img> 标签上包含高度和宽度

Pandoc docx to HTML include height and width on <img> tag

我正在使用 Pandoc 将 Microsoft .docx 文件转换为 HTML。当前使用 --extract-media 选项会生成 <img src='pandoc.image.png'> 形式的 <img> 标签,但不会将图像的 heightwidth 属性添加到 <img> 标签。 如何让 pandoc 将图像的高度和宽度属性作为属性添加到 <img> 标签?

我只能使用命令行进行转换,不能使用脚本。我 运行 的命令是 pandoc --from docx --to html input.docx --extract-media=/tmp/pandoc

不幸的是,Pandoc <1.16 doesn't support image sizes 在其内部 AST 中。所以目前这是不可能的。但是一旦 Docx Reader 也进行了调整,这将起作用。