From 8671bc5a1be38f6555e34d7ccc542ebbe91f69fd Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 5 Dec 2009 05:33:24 +0000 Subject: Markdown reader: Treat a backslash followed by a newline as hard linebreak. Resolves Issue #154. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1646 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/Markdown.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 4f0d1b6ad..c6926e3c1 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -863,10 +863,10 @@ escapedChar = do result <- option '\\' $ if stateStrict state then oneOf "\\`*_{}[]()>#+-.!~" else satisfy (not . isAlphaNum) - let result' = if result == ' ' - then '\160' -- '\ ' is a nonbreaking space - else result - return $ Str [result'] + return $ case result of + ' ' -> Str "\160" -- "\ " is a nonbreaking space + '\n' -> LineBreak -- "\[newline]" is a linebreak + _ -> Str [result] ltSign :: GenParser Char ParserState Inline ltSign = do -- cgit v1.2.3