git.iko.soy/typeable/pandoc
on master help sign in
Biblio: don't add footnote if empty.
d73a531John MacFarlane
src/Text/Pandoc/Biblio.hs+3−3
@@ -65,11 +65,11 @@ processCite s cs (i:is)
65 | Cite t _ <- i = process t ++ processCite s cs is
65 | Cite t _ <- i = process t ++ processCite s cs is
66 | otherwise = i : processCite s cs is
66 | otherwise = i : processCite s cs is
67 where
67 where
68+ addNt t x = if null x then [] else [Cite t $ renderPandoc s x]
68 process t = case M.lookup t cs of
69 process t = case M.lookup t cs of
69 Just x -> if isTextualCitation t && x /= []
70 Just x -> if isTextualCitation t && x /= []
70− then renderPandoc s [head x] ++ [Space] ++
71+ then renderPandoc s [head x] ++ [Space] ++ addNt t (tail x)
71− [Cite t $ renderPandoc s $ tail x]
72− else [Cite t $ renderPandoc s x]
72+ else [Cite t $ renderPandoc s x]
73 Nothing -> [Str ("Error processing " ++ show t)]
73 Nothing -> [Str ("Error processing " ++ show t)]
74
74
75isTextualCitation :: [Citation] -> Bool
75isTextualCitation :: [Citation] -> Bool