aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-05 05:33:24 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-05 05:33:24 +0000
commit8671bc5a1be38f6555e34d7ccc542ebbe91f69fd (patch)
treeb1dcbf74eb45462d3f6cb0493792fe2a94daf680 /src/Text
parent94841b7602f3465cdb7a452989975d08e43fc694 (diff)
downloadpandoc-8671bc5a1be38f6555e34d7ccc542ebbe91f69fd.tar.gz
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
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs8
1 files changed, 4 insertions, 4 deletions
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