aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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