diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-12-12 13:51:20 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-01-25 17:07:42 +0100 |
commit | 6aff97e4e16b3829151a5e84b63a0aee26ea8511 (patch) | |
tree | bdab822f07f9d868ab8714dc8a392f48278b8d6e /src/Text/Pandoc/PDF.hs | |
parent | 4cb124d147790814cf2055afdfd17e500cece559 (diff) | |
download | pandoc-6aff97e4e16b3829151a5e84b63a0aee26ea8511.tar.gz |
Text.Pandoc.Shared: Removed fetchItem, fetchItem'.
Made changes where these are used, so that the version
of fetchItem from PandocMonad can be used instead.
Diffstat (limited to 'src/Text/Pandoc/PDF.hs')
-rw-r--r-- | src/Text/Pandoc/PDF.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index 348f6a2fe..68151f569 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -49,8 +49,7 @@ import Data.Maybe (fromMaybe) import qualified Text.Pandoc.UTF8 as UTF8 import Text.Pandoc.Definition import Text.Pandoc.Walk (walkM) -import Text.Pandoc.Shared (fetchItem', warn, withTempDir, inDirectory, - stringify) +import Text.Pandoc.Shared (warn, withTempDir, inDirectory, stringify) import Text.Pandoc.Writers.Shared (getField, metaToJSON) import Text.Pandoc.Options (WriterOptions(..), HTMLMathMethod(..)) import Text.Pandoc.MIME (extensionFromMimeType, getMimeType) @@ -61,7 +60,7 @@ import qualified Codec.Picture as JP #ifdef _WINDOWS import Data.List (intercalate) #endif -import Text.Pandoc.Class (PandocIO, runIOorExplode) +import Text.Pandoc.Class (PandocIO, runIOorExplode, fetchItem, setMediaBag, runIO) #ifdef _WINDOWS changePathSeparators :: FilePath -> FilePath @@ -123,7 +122,9 @@ handleImage' opts tmpdir (Image attr ils (src,tit)) = do if exists then return $ Image attr ils (src,tit) else do - res <- fetchItem' (writerMediaBag opts) (writerSourceURL opts) src + res <- runIO $ do + setMediaBag $ writerMediaBag opts + fetchItem (writerSourceURL opts) src case res of Right (contents, Just mime) -> do let ext = fromMaybe (takeExtension src) $ |