git.iko.soy/typeable/pandoc
on master help sign in
Biblio: Workaround broken toCapital in citeproc-0.3.4.
db645f7John MacFarlane
src/Text/Pandoc/Biblio.hs+10−2
@@ -92,8 +92,16 @@ mvPunct (Space : x : ys) | isNote x = x : ys
92mvPunct xs = xs
92mvPunct xs = xs
93
93
94sanitize :: [Inline] -> [Inline]
94sanitize :: [Inline] -> [Inline]
95−sanitize xs | endWithPunct xs = toCapital xs
95+sanitize xs | endWithPunct xs = toCapital' xs
96− | otherwise = toCapital (xs ++ [Str "."])
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
97
105
98deNote :: [Block] -> [Block]
106deNote :: [Block] -> [Block]
99deNote = topDown go
107deNote = topDown go