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
This commit is contained in:
Jesse Rosenthal 2019-02-12 16:27:09 -05:00
parent bb2fa73500
commit 8552e188cd

View file

@ -486,8 +486,8 @@ archiveToNotes zf =
Just e -> elemToNameSpaces e
Nothing -> []
ns = unionBy (\x y -> fst x == fst y) fn_namespaces en_namespaces
fn = fnElem >>= elemToNotes ns "footnote"
en = enElem >>= elemToNotes ns "endnote"
fn = fnElem >>= walkDocument ns >>= elemToNotes ns "footnote"
en = enElem >>= walkDocument ns >>= elemToNotes ns "endnote"
in
Notes ns fn en
@ -498,7 +498,7 @@ archiveToComments zf =
cmts_namespaces = case cmtsElem of
Just e -> elemToNameSpaces e
Nothing -> []
cmts = elemToComments cmts_namespaces <$> cmtsElem
cmts = elemToComments cmts_namespaces <$> (cmtsElem >>= walkDocument cmts_namespaces)
in
case cmts of
Just c -> Comments cmts_namespaces c