@@ -126,8 +126,8 @@ escapeCode = concat . intersperse "\n" . map escapeLine . lines where
126126breakSentence :: [Inline] -> ([Inline], [Inline])
127127breakSentence [] = ([],[])
128128breakSentence xs =
129− let isSentenceEndInline (Str ".") = True
130− isSentenceEndInline (Str "?") = True
129+ let isSentenceEndInline (Str ys@(_:_)) | last ys == '.' = True
130+ isSentenceEndInline (Str ys@(_:_)) | last ys == '?' = True
131131 isSentenceEndInline (LineBreak) = True
132132 isSentenceEndInline _ = False
133133 (as, bs) = break isSentenceEndInline xs
@@ -135,8 +135,9 @@ breakSentence xs =
135135 [] -> (as, [])
136136 [c] -> (as ++ [c], [])
137137 (c:Space:cs) -> (as ++ [c], cs)
138− (Str ".":Str ")":cs) -> (as ++ [Str ".", Str ")"], cs)
139− (LineBreak:Str ".":cs) -> (as ++[LineBreak], Str ".":cs)
138+ (Str ".":Str (')':ys):cs) -> (as ++ [Str ".", Str (')':ys)], cs)
139+ (x@(Str ('.':')':_)):cs) -> (as ++ [x], cs)
140+ (LineBreak:x@(Str ('.':_)):cs) -> (as ++[LineBreak], x:cs)
140141 (c:cs) -> (as ++ [c] ++ ds, es)
141142 where (ds, es) = breakSentence cs
142143
@@ -285,7 +286,7 @@ blockListToMan opts blocks =
285286inlineListToMan :: WriterOptions -> [Inline] -> State WriterState Doc
286287-- if list starts with ., insert a zero-width character \& so it
287288-- won't be interpreted as markup if it falls at the beginning of a line.
288−inlineListToMan opts lst@(Str "." : _) = mapM (inlineToMan opts) lst >>=
289+inlineListToMan opts lst@(Str ('.':_) : _) = mapM (inlineToMan opts) lst >>=
289290 (return . (text "\\&" <>) . hcat)
290291inlineListToMan opts lst = mapM (inlineToMan opts) lst >>= (return . hcat)
291292