git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: use \ for newline instead of two spaces at eol.

(Unless --strict.)

commit78cea94f45b88ed68182f375ed81f3bd0092bd29 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 20 Dec 2010, 19:35 (16 years ago) parent8889ae8
2 files changed+5−2
src/Text/Pandoc/Writers/Markdown.hs+4−1 tests/writer.markdown+1−1
src/Text/Pandoc/Writers/Markdown.hs+4−1
@@ -439,7 +439,10 @@ inlineToMarkdown _ (Math DisplayMath str) =
439439 return $ "$$" <> text str <> "$$"
440440inlineToMarkdown _ (TeX str) = return $ text str
441441inlineToMarkdown _ (HtmlInline str) = return $ text str
442−inlineToMarkdown _ (LineBreak) = return $ " " <> cr
442+inlineToMarkdown opts (LineBreak) = return $
443+ if writerStrictMarkdown opts
444+ then " " <> cr
445+ else "\\" <> cr
443446inlineToMarkdown _ Space = return space
444447inlineToMarkdown opts (Cite (c:cs) lst)
445448 | writerCiteMethod opts == Citeproc = inlineListToMarkdown opts lst
tests/writer.markdown+1−1
@@ -41,7 +41,7 @@ item.
4141
4242Here’s one with a bullet. \* criminey.
4343
44−There should be a hard line break
44+There should be a hard line break\
4545here.
4646
4747* * * * *