aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-20 19:35:29 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-20 19:36:40 -0800
commit78cea94f45b88ed68182f375ed81f3bd0092bd29 (patch)
treec13b4f6e435d8eea08f4d247c298d7fa7c0f1373 /src/Text/Pandoc/Writers
parent8889ae8b5b091eb9d35bdf4698d39c562cb2e374 (diff)
downloadpandoc-78cea94f45b88ed68182f375ed81f3bd0092bd29.tar.gz
Markdown writer: use \ for newline instead of two spaces at eol.
(Unless --strict.)
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 50bf05a54..78666fdfe 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -439,7 +439,10 @@ inlineToMarkdown _ (Math DisplayMath str) =
return $ "$$" <> text str <> "$$"
inlineToMarkdown _ (TeX str) = return $ text str
inlineToMarkdown _ (HtmlInline str) = return $ text str
-inlineToMarkdown _ (LineBreak) = return $ " " <> cr
+inlineToMarkdown opts (LineBreak) = return $
+ if writerStrictMarkdown opts
+ then " " <> cr
+ else "\\" <> cr
inlineToMarkdown _ Space = return space
inlineToMarkdown opts (Cite (c:cs) lst)
| writerCiteMethod opts == Citeproc = inlineListToMarkdown opts lst