git.iko.soy/typeable/pandoc
on master help sign in
Biblio: small fix to detection of punctuation (A. Rossato).
5871c4dJohn MacFarlane
src/Text/Pandoc/Biblio.hs+4−4
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30module Text.Pandoc.Biblio ( processBiblio ) where
30module Text.Pandoc.Biblio ( processBiblio ) where
31
31
32import Control.Monad ( when )
32import Control.Monad ( when )
33−import Data.Char ( toUpper, isPunctuation )
33+import Data.Char ( toUpper )
34import Data.List
34import Data.List
35import Data.Unique
35import Data.Unique
36import Text.CSL hiding ( Cite(..), Citation(..) )
36import Text.CSL hiding ( Cite(..), Citation(..) )
@@ -129,12 +129,12 @@ mvCiteInNote is = procInlines mvCite
129
129
130 checkPt i
130 checkPt i
131 | Cite c o : xs <- i
131 | Cite c o : xs <- i
132− , headInline xs == lastInline o
132+ , endWPt o, startWPt xs
133 , endWPt o = Cite c (initInline o) : checkPt xs
133 , endWPt o = Cite c (initInline o) : checkPt xs
134 | x:xs <- i = x : checkPt xs
134 | x:xs <- i = x : checkPt xs
135 | otherwise = []
135 | otherwise = []
136− endWPt = and . map isPunctuation . lastInline
136+ endWPt = and . map (`elem` ".,;:!?") . lastInline
137− startWPt = and . map isPunctuation . headInline
137+ startWPt = and . map (`elem` ".,;:!?") . headInline
138 checkNt = processWith $ procInlines checkPt
138 checkNt = processWith $ procInlines checkPt
139
139
140headInline :: [Inline] -> String
140headInline :: [Inline] -> String