Pandoc convert/export md to docx produces square brackets around headings
What I’m trying to do
use pandoc to convert to docx.
Converted ok but I’m getting faint square brackets around headings. I cannot select them or get rid of them.
Pandoc version and system
pandoc 3.2.1
Features: +server +lua
Scripting engine: Lua 5.4
Windows 11 Pro – version 10.0.26120 Build 26120 – 64 GB Ram
Processor AMD Ryzen 7 3700X 8-Core Processor, 3593 MHz
Things I have tried
Upgrade pandoc to latest edition (2024-07-09).
Run pandoc md to docx from terminal instead of Obsidian-plugin.
Convert a doc with only headers in it:
# Header 1
## Header 2
### Header 3
pandoc minimal.md -o minimal.docx
Same problem with faint braces (I have a screenshot but can’t post it, I’m new here.).
Convert to odt
pandoc minimal.md -o minimal.odt
Same problem with faint braces. Brackets for Header 2 are in italic in .odt, not in .docx (I have screenshot but can’t post it. I’m new here.).
Convert to html to docx
pandoc minimal.md -o minimal.html
looks fine. Then:
pandoc minimal.html -o minimal.docx
Faint brackets are back again.
What it is not
It is not an issue ‘Wiki-links not removed when exporting from markdown’.
‘Pandoc md to docx’ converts links, images (imgur url) and all headers just fine.
Except for the faint square brackets. They appear where a header exists rather than a wikilink. IE where there is one or more “# ” in the md.
What I hope to find
(1) A way to use pandoc without getting the faint brackets in ms word docx. I love Markdown and Obsidian for writing. I need to be able to export to ms word.
(2) Plan B. If (1) is not possible a workaround/way to get rid of the faint brackets. I can’t select, find&replace or delete them and when I select all text (ctrl-a) and copy&paste the text to another doc, they are still there.
I’ve been looking around the web and over here. I found no answers, just one person having the same problem.
https://forum.obsidian.md/t/pandoc-export-to-docx-produces-square-brackets-around-headings/67824
Anybody ideas? So much appreciated.
thinkboxer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.