@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3030module Text.Pandoc.Biblio ( processBiblio ) where
3131
3232import Control.Monad ( when )
33−import Data.Char ( toUpper, isPunctuation )
33+import Data.Char ( toUpper )
3434import Data.List
3535import Data.Unique
3636import Text.CSL hiding ( Cite(..), Citation(..) )
@@ -129,12 +129,12 @@ mvCiteInNote is = procInlines mvCite
129129
130130 checkPt i
131131 | Cite c o : xs <- i
132− , headInline xs == lastInline o
132+ , endWPt o, startWPt xs
133133 , endWPt o = Cite c (initInline o) : checkPt xs
134134 | x:xs <- i = x : checkPt xs
135135 | otherwise = []
136− endWPt = and . map isPunctuation . lastInline
137− startWPt = and . map isPunctuation . headInline
136+ endWPt = and . map (`elem` ".,;:!?") . lastInline
137+ startWPt = and . map (`elem` ".,;:!?") . headInline
138138 checkNt = processWith $ procInlines checkPt
139139
140140headInline :: [Inline] -> String