@@ -100,12 +100,13 @@ import Text.Pandoc.Compat.Except
100100readDocxWithWarnings :: ReaderOptions
101101 -> B.ByteString
102102 -> Either PandocError (Pandoc, MediaBag, [String])
103−readDocxWithWarnings opts bytes =
104− case archiveToDocxWithWarnings (toArchive bytes) of
105− Right (docx, warnings) -> do
103+readDocxWithWarnings opts bytes
104+ | Right archive <- toArchiveOrFail bytes
105+ , Right (docx, warnings) <- archiveToDocxWithWarnings archive = do
106106 (meta, blks, mediaBag) <- docxToOutput opts docx
107107 return (Pandoc meta blks, mediaBag, warnings)
108− Left _ -> Left (ParseFailure "couldn't parse docx file")
108+readDocxWithWarnings _ _ =
109+ Left (ParseFailure "couldn't parse docx file")
109110
110111readDocx :: ReaderOptions
111112 -> B.ByteString