先にこれを書いておけと…
ここ最近はdocx -> mdの変換(正確にはmdから作成したdocxをmdに戻して前後で同じmdとなるかの確認)をしていましたが、そもそもdocxのReaderは一部の記法について対応していません。
これは対応するソースのコメントを見ればわかります。
以下、抜粋。
* Blocks - [X] Para - [X] CodeBlock (styled with `SourceCode`) - [X] BlockQuote (styled with `Quote`, `BlockQuote`, or, optionally, indented) - [X] OrderedList - [X] BulletList - [X] DefinitionList (styled with adjacent `DefinitionTerm` and `Definition`) - [X] Header (styled with `Heading#`) - [ ] HorizontalRule - [-] Table (column widths and alignments not yet implemented) * Inlines - [X] Str - [X] Emph - [X] Strong - [X] Strikeout - [X] Superscript - [X] Subscript - [X] SmallCaps - [-] Underline (was previously converted to Emph) - [ ] Quoted - [ ] Cite - [X] Code (styled with `VerbatimChar`) - [X] Space - [X] LineBreak (these are invisible in Word: entered with Shift-Return) - [X] Math - [X] Link (links to an arbitrary bookmark create a span with the target as id and "anchor" class) - [X] Image - [X] Note (Footnotes and Endnotes are silently combined.) -}
ブロック要素(段落要素)だと水平線がNG、表は幅とアライメントが対応していない。インライン要素だと下線、引用(Quoted, Cite)が対応していませんね。
また、ここに記載がないものの、LineBlockが対応できていないようです(これはまた別の記事で書きます)
ということで、単純にPandocのdocx Readerの機能面からみても現時点で完全な書き戻しというのは難しいということがわかります。これ以外については原則書き戻しは出来ると思いますので、引き続き見ていきます。