From 78cea94f45b88ed68182f375ed81f3bd0092bd29 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 20 Dec 2010 19:35:29 -0800 Subject: Markdown writer: use \ for newline instead of two spaces at eol. (Unless --strict.) --- src/Text/Pandoc/Writers/Markdown.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Writers') 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 -- cgit v1.2.3