Friday, March 18, 2022

[SOLVED] pandoc docx to md with images conversion problem

Issue

pandoc docx to md batch conversion with images but it's not correctly converting. here is my command

for item in *.docx; do pandoc "$item" -o "${item%.docx}.md" --extract-media=. "$item" ; done

document link(dropbox)


Solution

found the soultion docx2md.sh code edited to pandoc -f docx -t markdown -w gfm --extract-media="." -o "$1.md" "../$1.docx" avoid img tag and name conflict. Run

for item in *.docx; do file=${item::-5}; ./docx2md.sh "$file" ; done


Answered By - sentil
Answer Checked By - Dawn Plyler (WPSolving Volunteer)