aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index a0d6e9968..97291d501 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -625,9 +625,8 @@ table = failIfStrict >> (simpleTable <|> multilineTable) <?> "table"
inline = choice [ str
, smartPunctuation
- , linebreak
- , endline
, whitespace
+ , endline
, code
, charRef
, strong
@@ -766,11 +765,11 @@ enDash = try $ char '-' >> notFollowedBy (noneOf "0123456789") >> return EnDash
emDash = try $ skipSpaces >> oneOfStrings ["---", "--"] >>
skipSpaces >> return EmDash
-whitespace = (many1 (oneOf spaceChars) >> return Space) <?> "whitespace"
-
--- hard line break
-linebreak = try $ oneOf spaceChars >> many1 (oneOf spaceChars) >>
- endline >> return LineBreak
+whitespace = do
+ sps <- many1 (oneOf spaceChars)
+ if length sps >= 2
+ then option Space (endline >> return LineBreak)
+ else return Space <?> "whitespace"
nonEndline = satisfy (/='\n')