diff options
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Writers/Man.hs | 6 | ||||
| -rw-r--r-- | src/Text/Pandoc/Writers/Shared.hs | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index a32733ec3..b1de1bffb 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -311,8 +311,8 @@ inlineToMan _ il@(RawInline f str) return empty inlineToMan _ LineBreak = return $ cr <> literal ".PD 0" $$ literal ".P" $$ literal ".PD" <> cr -inlineToMan _ SoftBreak = return space -inlineToMan _ Space = return space +inlineToMan _ SoftBreak = return $ afterBreak "\\" <> space +inlineToMan _ Space = return $ afterBreak "\\" <> space inlineToMan opts (Link _ txt (src, _)) | not (isURI src) = inlineListToMan opts txt -- skip relative links | otherwise = do @@ -323,7 +323,7 @@ inlineToMan opts (Link _ txt (src, _)) let (start, end) = if "mailto:" `T.isPrefixOf` src then (".MT", ".ME") else (".UR", ".UE") - return $ cr + return $ "\\c" <> cr -- \c avoids extra space $$ (start <+> literal srcSuffix) $$ linktext $$ (end <+> "\\c" <> cr) -- \c avoids space after diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs index 7a374102b..6e6e084f2 100644 --- a/src/Text/Pandoc/Writers/Shared.hs +++ b/src/Text/Pandoc/Writers/Shared.hs @@ -50,7 +50,7 @@ import Safe (lastMay) import qualified Data.ByteString.Lazy as BL import Control.Monad (zipWithM) import Data.Aeson (ToJSON (..), encode) -import Data.Char (chr, ord, isSpace, isLetter) +import Data.Char (chr, ord, isSpace, isLetter, isUpper) import Data.List (groupBy, intersperse, transpose, foldl') import Data.List.NonEmpty (NonEmpty(..), nonEmpty) import Data.Text.Conversions (FromText(..)) @@ -552,10 +552,10 @@ splitSentences :: Doc Text -> Doc Text splitSentences = go . toList where go [] = mempty - go (Text len t : BreakingSpace : xs) = - if isSentenceEnding t - then Text len t <> NewLine <> go xs - else Text len t <> BreakingSpace <> go xs + go (Text len t : AfterBreak _ : BreakingSpace : xs) + | isSentenceEnding t = Text len t <> NewLine <> go xs + go (Text len t : BreakingSpace : xs) + | isSentenceEnding t = Text len t <> NewLine <> go xs go (x:xs) = x <> go xs toList (Concat (Concat a b) c) = toList (Concat a (Concat b c)) |
