summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-08-02 15:37:09 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2013-08-02 15:37:09 -0700
commita32417378e8023b5dd8af4d8a9ea66eddb99a0eb (patch)
treee055476110f2ce1f1e1fc1451565b469505bc23d /src
parentdceffeb04370e8661dd0534a6e97fd15caaeddcf (diff)
Biblio: Don't interfere with Notes that aren't citation notes.
Closes #898: notes not generated from citations were being adjusted (first letter capitalized, for example, against author's intentions).
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Biblio.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs
index 31c55472e..d0db35ae7 100644
--- a/src/Text/Pandoc/Biblio.hs
+++ b/src/Text/Pandoc/Biblio.hs
@@ -53,7 +53,7 @@ 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 mvPunct . deNote . bottomUp (processCite style cits_map) $ p'
+ Pandoc m b = bottomUp mvPunct . deNote . topDown (processCite style cits_map) $ p'
in Pandoc m $ b ++ biblioList
-- | Substitute 'Cite' elements with formatted citations.
@@ -103,7 +103,8 @@ endWithPunct xs@(_:_) = case reverse (stringify [last xs]) of
deNote :: Pandoc -> Pandoc
deNote = topDown go
- where go (Note [Para xs]) = Note $ bottomUp go' [Para $ sanitize xs]
+ where go (Cite cs [Note [Para xs]]) =
+ Cite cs [Note $ bottomUp go' [Para $ sanitize xs]]
go (Note xs) = Note $ bottomUp go' xs
go x = x
go' (Note [Para xs]:ys) =