From d73a531d899600ab9999b798129dc0fa6185ef7f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 16 Nov 2010 07:15:30 -0800 Subject: Biblio: don't add footnote if empty. --- src/Text/Pandoc/Biblio.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Biblio.hs') diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs index bca24d815..05cc296c1 100644 --- a/src/Text/Pandoc/Biblio.hs +++ b/src/Text/Pandoc/Biblio.hs @@ -65,11 +65,11 @@ processCite s cs (i:is) | Cite t _ <- i = process t ++ processCite s cs is | otherwise = i : processCite s cs is where + addNt t x = if null x then [] else [Cite t $ renderPandoc s x] process t = case M.lookup t cs of Just x -> if isTextualCitation t && x /= [] - then renderPandoc s [head x] ++ [Space] ++ - [Cite t $ renderPandoc s $ tail x] - else [Cite t $ renderPandoc s x] + then renderPandoc s [head x] ++ [Space] ++ addNt t (tail x) + else [Cite t $ renderPandoc s x] Nothing -> [Str ("Error processing " ++ show t)] isTextualCitation :: [Citation] -> Bool -- cgit v1.2.3