diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2011-11-06 16:48:16 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2011-11-06 16:48:16 -0800 |
commit | ca5f4434c2652f778fab32cba6db6fc740c62cbb (patch) | |
tree | 13aa7c9b9160b762183c525b05604f6b36ab3eb4 /src/Text | |
parent | 380fa067201da45534db0e5945126dff594382c9 (diff) | |
download | pandoc-ca5f4434c2652f778fab32cba6db6fc740c62cbb.tar.gz |
Further simplification of Biblio.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Biblio.hs | 15 |
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 |