summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-01-08 17:23:56 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-01-08 17:24:18 -0800
commit7a40fa8c08996cb94e7ff3cfafd8ede84972ce70 (patch)
tree348967547ee81a366b459b87797ac09622395326 /src
parentd1ebde08a97ef5409d63fb588845e89851bcab8c (diff)
Biblio: Make sure mvPunc and deNote run on metadata too.
This fixed a bug with notes on titles using footnote styles.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Biblio.hs7
1 files changed, 3 insertions, 4 deletions
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