summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Shared.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs
index 7a2fee7ec..7a374102b 100644
--- a/src/Text/Pandoc/Writers/Shared.hs
+++ b/src/Text/Pandoc/Writers/Shared.hs
@@ -565,12 +565,16 @@ splitSentences = go . toList
isSentenceEnding t =
case T.unsnoc t of
Just (t',c)
- | c == '.' || c == '!' || c == '?' -> True
+ | c == '.' || c == '!' || c == '?'
+ , not (isInitial t') -> True
| c == ')' || c == ']' || c == '"' || c == '\x201D' ->
case T.unsnoc t' of
- Just (_,d) -> d == '.' || d == '!' || d == '?'
+ Just (t'',d) -> d == '.' || d == '!' || d == '?' &&
+ not (isInitial t'')
_ -> False
_ -> False
+ where
+ isInitial x = T.length x == 1 && T.all isUpper x
-- | Ensure that all identifiers start with a letter,
-- and modify internal links accordingly. (Yes, XML allows an