From 00662faefbca0b9889d3d79dbb2985350356d18a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 31 Jul 2014 11:04:40 -0700 Subject: Made MediaBag a newtype, and added mime type information to media. Shared now exports functions for interacting with a MediaBag: - `emptyMediaBag` - `lookuMedia` - `insertMedia` - `mediaDirectory` - `extractMediaBag` --- src/Text/Pandoc/Readers/Docx.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs index f5fb6565a..2fb4da2d9 100644 --- a/src/Text/Pandoc/Readers/Docx.hs +++ b/src/Text/Pandoc/Readers/Docx.hs @@ -108,7 +108,7 @@ data DState = DState { docxAnchorMap :: M.Map String String defaultDState :: DState defaultDState = DState { docxAnchorMap = M.empty - , docxMediaBag = M.empty + , docxMediaBag = emptyMediaBag , docxInHeaderBlock = False , docxInTexSubscript = False} @@ -369,7 +369,7 @@ parPartToInlines (BookMark _ anchor) = return [Span (newAnchor, ["anchor"], []) []] parPartToInlines (Drawing fp bs) = do mediaBag <- gets docxMediaBag - modify $ \s -> s { docxMediaBag = M.insert fp bs mediaBag} + modify $ \s -> s { docxMediaBag = insertMedia fp Nothing bs mediaBag } return [Image [] (fp, "")] parPartToInlines (InternalHyperLink anchor runs) = do ils <- concatMapM runToInlines runs -- cgit v1.2.3