Repository navigation
We compared four markdown-to-Word paths. docx/html won. #3827
xronocode
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I maintain Mark, a markdown editor that runs in a webview and ships to the App Store. Its DOCX export has to happen entirely inside the app: no pandoc, no external processes.
We compared four converters on one document with English, Russian and Chinese text, math, footnotes, task lists and tables: markdown-docx, remark-docx, mdast2docx, and docx's own HTML importer (the htmlToContent function from docx/html). For the last one we simply used the HTML our editor already renders, including KaTeX output and markdown-style footnotes.
The docx/html path won on our document:
The whole path is about 237 KB gzipped as a browser bundle, and we load it only on first export.
Fair scope note: this was one synthetic document, and we checked the generated files at the XML level (document.xml, footnotes.xml, numbering.xml). The visual pass in Word and Pages comes next.
We plan to build our DOCX export on this, and I will report back here when the release is out. Thank you for building exactly the right tool for an editor that already has rendered HTML.
All reactions