git.iko.soy/typeable/pandoc
on master help sign in
Combined linebreak and whitespace into a new whitespace
85d49eefiddlosopher
src/Text/Pandoc/Readers/Markdown.hs+6−7
@@ -625,9 +625,8 @@ table = failIfStrict >> (simpleTable <|> multilineTable) <?> "table"
625
625
626inline = choice [ str
626inline = choice [ str
627 , smartPunctuation
627 , smartPunctuation
628− , linebreak
629− , endline
630 , whitespace
628 , whitespace
629+ , endline
631 , code
630 , code
632 , charRef
631 , charRef
633 , strong
632 , strong
@@ -766,11 +765,11 @@ enDash = try $ char '-' >> notFollowedBy (noneOf "0123456789") >> return EnDash
766emDash = try $ skipSpaces >> oneOfStrings ["---", "--"] >>
765emDash = try $ skipSpaces >> oneOfStrings ["---", "--"] >>
767 skipSpaces >> return EmDash
766 skipSpaces >> return EmDash
768
767
768+whitespace = do
769−whitespace = (many1 (oneOf spaceChars) >> return Space) <?> "whitespace"
769+ sps <- many1 (oneOf spaceChars)
770−
770+ if length sps >= 2
771−-- hard line break
772−linebreak = try $ oneOf spaceChars >> many1 (oneOf spaceChars) >>
773− endline >> return LineBreak
771+ then option Space (endline >> return LineBreak)
772+ else return Space <?> "whitespace"
774
773
775nonEndline = satisfy (/='\n')
774nonEndline = satisfy (/='\n')
776
775