summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-30 17:23:16 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-30 17:23:16 +0200
commit8d50f37d533b48fedcbaa953964771a759a1421d (patch)
tree95f26b85fe18fc72da9e23ad070062b7c09cab62 /src/Text/Pandoc
parent6ad486c3c3922e4ac7dd5710f69c3ccf623e92b4 (diff)
Don't read jats.csl unless we actually need it.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/App.hs11
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