aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Biblio.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-11-16 07:15:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-11-16 07:15:30 -0800
commitd73a531d899600ab9999b798129dc0fa6185ef7f (patch)
treef06620b2e219e95b40419ac1e0657a40c73bce20 /src/Text/Pandoc/Biblio.hs
parentb158ae21a21d8e8c2ca13ea2b89ea4f1c8bb5cdd (diff)
downloadpandoc-d73a531d899600ab9999b798129dc0fa6185ef7f.tar.gz
Biblio: don't add footnote if empty.
Diffstat (limited to 'src/Text/Pandoc/Biblio.hs')
-rw-r--r--src/Text/Pandoc/Biblio.hs6
1 files changed, 3 insertions, 3 deletions
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