summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-06-08 10:28:51 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-06-08 10:28:51 -0700
commitdb645f708757dca60c58d285bf37d33a294db3e1 (patch)
tree5f0e6e43fb9237aaed5c73d10c108bf976559295 /src/Text/Pandoc
parent5fe9542ca8bab1d455fc70f2e880b56feb186033 (diff)
Biblio: Workaround broken toCapital in citeproc-0.3.4.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Biblio.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs
index 45c12cc96..38366ee26 100644
--- a/src/Text/Pandoc/Biblio.hs
+++ b/src/Text/Pandoc/Biblio.hs
@@ -92,8 +92,16 @@ mvPunct (Space : x : ys) | isNote x = x : ys
mvPunct xs = xs
sanitize :: [Inline] -> [Inline]
-sanitize xs | endWithPunct xs = toCapital xs
- | otherwise = toCapital (xs ++ [Str "."])
+sanitize xs | endWithPunct xs = toCapital' xs
+ | otherwise = toCapital' (xs ++ [Str "."])
+
+-- NOTE: toCapital' works around a bug in toCapital from citeproc-hs 0.3.4.
+-- When citeproc-hs is fixed, we can return to using toCapital in sanitize.
+toCapital' :: [Inline] -> [Inline]
+toCapital' [] = []
+toCapital' xs = case toCapital xs of
+ [] -> xs
+ ys -> ys
deNote :: [Block] -> [Block]
deNote = topDown go