diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-07-29 20:54:25 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-07-30 07:43:55 -0700 |
commit | 7f9e950d8da52dd2333843d7fd85d000c4a1cbe3 (patch) | |
tree | eacaaea2c3d2a8f9522b7673e76c9f79b54c1c74 /src/Text/Pandoc/App.hs | |
parent | 200b5fb60ce1372da592dafd0a2f587f0083d72f (diff) |
Class: Removed unnecessary withMedia, improved haddocks.
Diffstat (limited to 'src/Text/Pandoc/App.hs')
-rw-r--r-- | src/Text/Pandoc/App.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 0d4a82b70..498cfae22 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -76,7 +76,7 @@ import System.IO.Error (isDoesNotExistError) import Text.Pandoc import Text.Pandoc.Builder (setMeta) import Text.Pandoc.Class (PandocIO, extractMedia, fillMediaBag, getLog, - setResourcePath, withMediaBag, setTrace) + setResourcePath, getMediaBag, setTrace) import Text.Pandoc.Highlighting (highlightingStyles) import Text.Pandoc.Lua (runLuaFilter, LuaException(..)) import Text.Pandoc.Writers.Math (defaultMathJaxURL, defaultKaTeXURL) @@ -445,7 +445,7 @@ convertWithOpts opts = do runIO' $ do setResourcePath (optResourcePath opts) - (doc, media) <- withMediaBag $ sourceToDoc sources >>= + doc <- sourceToDoc sources >>= ( (if isJust (optExtractMedia opts) then fillMediaBag (writerSourceURL writerOptions) else return) @@ -455,6 +455,7 @@ convertWithOpts opts = do >=> applyLuaFilters datadir (optLuaFilters opts) [format] >=> applyFilters datadir filters' [format] ) + media <- getMediaBag case writer of ByteStringWriter f -> f writerOptions doc >>= writeFnBinary outputFile |