aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-11-06 16:48:16 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-11-06 16:48:16 -0800
commitca5f4434c2652f778fab32cba6db6fc740c62cbb (patch)
tree13aa7c9b9160b762183c525b05604f6b36ab3eb4
parent380fa067201da45534db0e5945126dff594382c9 (diff)
downloadpandoc-ca5f4434c2652f778fab32cba6db6fc740c62cbb.tar.gz
Further simplification of Biblio.
-rw-r--r--src/Text/Pandoc/Biblio.hs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs
index 723c7ed10..c824f63c5 100644
--- a/src/Text/Pandoc/Biblio.hs
+++ b/src/Text/Pandoc/Biblio.hs
@@ -66,13 +66,14 @@ processBiblio cslfile r p
processCite :: Style -> M.Map [Citation] [FormattedOutput] -> Inline -> [Inline]
processCite s cs (Cite t _) =
case M.lookup t cs of
- Just x -> if isTextualCitation t
- then renderPandoc s (take 1 x) ++
- case drop 1 x of
- [] -> []
- ys -> [Space, Cite t $ renderPandoc s ys]
- else [Cite t $ renderPandoc s x]
- Nothing -> [Str ("Error processing " ++ show t)]
+ Just (x:xs) ->
+ if isTextualCitation t
+ then renderPandoc s [x] ++
+ if null xs
+ then []
+ else [Space, Cite t $ renderPandoc s xs]
+ else [Cite t $ renderPandoc s (x:xs)]
+ _ -> [Str ("Error processing " ++ show t)]
processCite _ _ x = [x]
isTextualCitation :: [Citation] -> Bool