Don't read jats.csl unless we actually need it.

This commit is contained in:
John MacFarlane 2017-03-30 17:23:16 +02:00
parent 6ad486c3c3
commit 8d50f37d53

View file

@ -386,11 +386,12 @@ convertWithOpts opts = do
withMediaBag . r readerOpts) sources withMediaBag . r readerOpts) sources
return (mconcat (map fst pairs), mconcat (map snd pairs)) return (mconcat (map fst pairs), mconcat (map snd pairs))
jatsCSL <- readDataFile datadir "jats.csl" metadata <- if format == "jats"
let jatsEncoded = makeDataURI ("application/xml", jatsCSL) then do
let metadata = if format == "jats" jatsCSL <- readDataFile datadir "jats.csl"
then ("csl", jatsEncoded) : optMetadata opts let jatsEncoded = makeDataURI ("application/xml", jatsCSL)
else optMetadata opts return $ ("csl", jatsEncoded) : optMetadata opts
else return $ optMetadata opts
runIO' $ do runIO' $ do
(doc, media) <- sourceToDoc sources (doc, media) <- sourceToDoc sources