git.iko.soy/typeable/pandoc
on master help sign in
Docx writer: Improved entryFromArchive to avoid parse.
326d7faJohn MacFarlane
src/Text/Pandoc/Writers/Docx.hs+3−2
@@ -310,8 +310,9 @@ writeDocx opts doc@(Pandoc meta _) = do
310 let relsEntry = toEntry relsPath epochtime $ renderXml rels
310 let relsEntry = toEntry relsPath epochtime $ renderXml rels
311
311
312 let entryFromArchive arch path =
312 let entryFromArchive arch path =
313− (toEntry path epochtime . renderXml) `fmap`
313+ maybe (fail $ path ++ " corrupt or missing in reference docx")
314− parseXml arch distArchive path
314+ return
315+ (findEntryByPath path arch `mplus` findEntryByPath path distArchive)
315 docPropsAppEntry <- entryFromArchive refArchive "docProps/app.xml"
316 docPropsAppEntry <- entryFromArchive refArchive "docProps/app.xml"
316 themeEntry <- entryFromArchive refArchive "word/theme/theme1.xml"
317 themeEntry <- entryFromArchive refArchive "word/theme/theme1.xml"
317 fontTableEntry <- entryFromArchive refArchive "word/fontTable.xml"
318 fontTableEntry <- entryFromArchive refArchive "word/fontTable.xml"