1

I have a Word document that contains a TOC, various headings level 1, 2 & 3, some tables and some images.

When I export to .MD using pandoc -f docx -t markdown the resultant .MD when viewed in Chrome has no images. Instead, I see something like {width="6.268055555555556in" height="3.2933442694663166in"} but no actual image.

Do I have to add a tag to the images for Pandoc to export them out?

6
  • Did you try with --extract-media=media? Commented Jul 11, 2023 at 14:18
  • Tried to add that, and it doesn't make a difference. Commented Jul 11, 2023 at 14:38
  • How do the images exactly look in the Markdown after that? Is the media folder created? Commented Jul 11, 2023 at 14:43
  • No different, still just {width} and {height} tags and no sub-dir. Commented Jul 11, 2023 at 14:44
  • What about --extract-media=.? If still nothing, what kind of images are these? Commented Jul 11, 2023 at 14:53

1 Answer 1

2

So I managed to get this working by passing in --extract-media="c:\help\output" which creates a sub-directory of \media.

The MD file then has a path to the image as ![](c:\help\output/media/image1.png) so I have to then change the path in the MD to ![alt text](media/image1.png).

The image then loads in the browser.

EDIT: I later found out that by using -t markdown_mmd I don't need to edit the path to the file.

Kudos to @Destroy666 for the assist.

1
  • one can also specify --extract-media="./" which then creates relative paths directly. Commented Jan 24, 2024 at 14:51

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.