git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: unwrap sdt elements in footnotes and comments.

We had previously walked the document to unwrap sdt/sdtContent and smartTag tags in `word/document.xml`, but not in the `word/{foot/end}note.xml` and `word/comments.xml`. Closes #5302

commit8552e188cdac82ad6810a9b58450671fc4ceca18 authorJesse Rosenthal <jrosenthal@jhu.edu> dateTue 12 Feb 2019, 16:27 (8 years ago) parentbb2fa73
1 file changed+3−3
src/Text/Pandoc/Readers/Docx/Parse.hs+3−3
src/Text/Pandoc/Readers/Docx/Parse.hs+3−3
@@ -486,8 +486,8 @@ archiveToNotes zf =
486486 Just e -> elemToNameSpaces e
487487 Nothing -> []
488488 ns = unionBy (\x y -> fst x == fst y) fn_namespaces en_namespaces
489− fn = fnElem >>= elemToNotes ns "footnote"
490− en = enElem >>= elemToNotes ns "endnote"
489+ fn = fnElem >>= walkDocument ns >>= elemToNotes ns "footnote"
490+ en = enElem >>= walkDocument ns >>= elemToNotes ns "endnote"
491491 in
492492 Notes ns fn en
493493
@@ -498,7 +498,7 @@ archiveToComments zf =
498498 cmts_namespaces = case cmtsElem of
499499 Just e -> elemToNameSpaces e
500500 Nothing -> []
501− cmts = elemToComments cmts_namespaces <$> cmtsElem
501+ cmts = elemToComments cmts_namespaces <$> (cmtsElem >>= walkDocument cmts_namespaces)
502502 in
503503 case cmts of
504504 Just c -> Comments cmts_namespaces c