aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-03-07 12:50:56 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2012-03-07 12:50:56 -0800
commit7a5f51eb9579f3738dfe60e1cc31ce40bac88b30 (patch)
tree1c5eea502253c27032e52ba9fbfc68fd72fdd9b4 /src/Text
parent45aed516285d171a1d4113c4095e91dbb78eac60 (diff)
parent2d1703e8a00349a1f76961a78688cb52f4d4e903 (diff)
downloadpandoc-7a5f51eb9579f3738dfe60e1cc31ce40bac88b30.tar.gz
Merge pull request #438 from michaelt/patch-2
Fix initial `Str "."` after `LineBreak` as well?
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Man.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
index a0ac16b85..02dd45c4a 100644
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -128,6 +128,7 @@ breakSentence [] = ([],[])
breakSentence xs =
let isSentenceEndInline (Str ".") = True
isSentenceEndInline (Str "?") = True
+ isSentenceEndInline (LineBreak) = True
isSentenceEndInline _ = False
(as, bs) = break isSentenceEndInline xs
in case bs of
@@ -135,6 +136,7 @@ breakSentence xs =
[c] -> (as ++ [c], [])
(c:Space:cs) -> (as ++ [c], cs)
(Str ".":Str ")":cs) -> (as ++ [Str ".", Str ")"], cs)
+ (LineBreak:Str ".":cs) -> (as ++[LineBreak], Str ".":cs)
(c:cs) -> (as ++ [c] ++ ds, es)
where (ds, es) = breakSentence cs