git.iko.soy/typeable/pandoc
on master help sign in
Biblio: Workaround broken toCapital in citeproc-0.3.4.
commitdb645f708757dca60c58d285bf37d33a294db3e1 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 8 Jun 2012, 10:28 (14 years ago) parent5fe9542
1 file changed+10−2
src/Text/Pandoc/Biblio.hs+10−2
src/Text/Pandoc/Biblio.hs+10−2
@@ -92,8 +92,16 @@ mvPunct (Space : x : ys) | isNote x = x : ys
9292mvPunct xs = xs
9393
9494sanitize :: [Inline] -> [Inline]
95−sanitize xs | endWithPunct xs = toCapital xs
96− | otherwise = toCapital (xs ++ [Str "."])
95+sanitize xs | endWithPunct xs = toCapital' xs
96+ | otherwise = toCapital' (xs ++ [Str "."])
97+
98+-- NOTE: toCapital' works around a bug in toCapital from citeproc-hs 0.3.4.
99+-- When citeproc-hs is fixed, we can return to using toCapital in sanitize.
100+toCapital' :: [Inline] -> [Inline]
101+toCapital' [] = []
102+toCapital' xs = case toCapital xs of
103+ [] -> xs
104+ ys -> ys
97105
98106deNote :: [Block] -> [Block]
99107deNote = topDown go