diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-30 17:23:16 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-30 17:23:16 +0200 |
commit | 8d50f37d533b48fedcbaa953964771a759a1421d (patch) | |
tree | 95f26b85fe18fc72da9e23ad070062b7c09cab62 /src/Text/Pandoc | |
parent | 6ad486c3c3922e4ac7dd5710f69c3ccf623e92b4 (diff) | |
download | pandoc-8d50f37d533b48fedcbaa953964771a759a1421d.tar.gz |
Don't read jats.csl unless we actually need it.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/App.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index e45d10254..ce4c87ec1 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -386,11 +386,12 @@ convertWithOpts opts = do withMediaBag . r readerOpts) sources return (mconcat (map fst pairs), mconcat (map snd pairs)) - jatsCSL <- readDataFile datadir "jats.csl" - let jatsEncoded = makeDataURI ("application/xml", jatsCSL) - let metadata = if format == "jats" - then ("csl", jatsEncoded) : optMetadata opts - else optMetadata opts + metadata <- if format == "jats" + then do + jatsCSL <- readDataFile datadir "jats.csl" + let jatsEncoded = makeDataURI ("application/xml", jatsCSL) + return $ ("csl", jatsEncoded) : optMetadata opts + else return $ optMetadata opts runIO' $ do (doc, media) <- sourceToDoc sources |