From 7a40fa8c08996cb94e7ff3cfafd8ede84972ce70 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 8 Jan 2013 17:23:56 -0800 Subject: Biblio: Make sure mvPunc and deNote run on metadata too. This fixed a bug with notes on titles using footnote styles. --- src/Text/Pandoc/Biblio.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs index 1554d1861..4dd82dd08 100644 --- a/src/Text/Pandoc/Biblio.hs +++ b/src/Text/Pandoc/Biblio.hs @@ -53,9 +53,8 @@ processBiblio (Just style) r p = map (map toCslCite) grps) cits_map = M.fromList $ zip grps (citations result) biblioList = map (renderPandoc' style) (bibliography result) - Pandoc m b = bottomUp (processCite style cits_map) p' - b' = bottomUp mvPunct $ deNote b - in Pandoc m $ b' ++ biblioList + Pandoc m b = bottomUp mvPunct . deNote . bottomUp (processCite style cits_map) $ p' + in Pandoc m $ b ++ biblioList -- | Substitute 'Cite' elements with formatted citations. processCite :: Style -> M.Map [Citation] [FormattedOutput] -> Inline -> Inline @@ -89,7 +88,7 @@ sanitize :: [Inline] -> [Inline] sanitize xs | endWithPunct xs = toCapital xs | otherwise = toCapital (xs ++ [Str "."]) -deNote :: [Block] -> [Block] +deNote :: Pandoc -> Pandoc deNote = topDown go where go (Note [Para xs]) = Note $ bottomUp go' [Para $ sanitize xs] go (Note xs) = Note $ bottomUp go' xs -- cgit v1.2.3