@@ -69,7 +69,8 @@ implemented, [-] means partially implemented):
6969-}
7070
7171module Text.Pandoc.Readers.Docx
72− ( readDocx
72+ ( readDocxWithWarnings
73+ , readDocx
7374 ) where
7475
7576import Codec.Archive.Zip
@@ -96,14 +97,22 @@ import qualified Data.Sequence as Seq (null)
9697import Text.Pandoc.Error
9798import Text.Pandoc.Compat.Except
9899
100+readDocxWithWarnings :: ReaderOptions
101+ -> B.ByteString
102+ -> Either PandocError (Pandoc, MediaBag, [String])
103+readDocxWithWarnings opts bytes =
104+ case archiveToDocxWithWarnings (toArchive bytes) of
105+ Right (docx, warnings) -> do
106+ (meta, blks, mediaBag) <- docxToOutput opts docx
107+ return (Pandoc meta blks, mediaBag, warnings)
108+ Left _ -> Left (ParseFailure "couldn't parse docx file")
109+
99110readDocx :: ReaderOptions
100111 -> B.ByteString
101112 -> Either PandocError (Pandoc, MediaBag)
102−readDocx opts bytes =
103− case archiveToDocx (toArchive bytes) of
104− Right docx -> (\(meta, blks, mediaBag) -> (Pandoc meta blks, mediaBag))
105− <$> (docxToOutput opts docx)
106− Left _ -> Left (ParseFailure "couldn't parse docx file")
113+readDocx opts bytes = do
114+ (pandoc, mediaBag, _) <- readDocxWithWarnings opts bytes
115+ return (pandoc, mediaBag)
107116
108117data DState = DState { docxAnchorMap :: M.Map String String
109118 , docxMediaBag :: MediaBag