aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-12 00:22:49 +0200
committerAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-12 10:47:49 +0200
commit36066699c31ca50566ca2492a5c112ecbe690a63 (patch)
treeaa0086aa11650b5f228bc4eb706ed406444491c1
parent8bc09ce6c7ae118318241b0b0a31c946534259c6 (diff)
downloadpandoc-36066699c31ca50566ca2492a5c112ecbe690a63.tar.gz
Org writer: Fix output for linebreaks
Hard linebreaks in Org mode are represented by the string "\\" as the last characters in a line. Adds this feature to the Org-mode writer.
-rw-r--r--src/Text/Pandoc/Writers/Org.hs2
-rw-r--r--tests/writer.org2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index d318c5f6a..58a5729e7 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -271,7 +271,7 @@ inlineToOrg (Math t str) = do
else "$$" <> text str <> "$$"
inlineToOrg (RawInline f str) | f == "tex" || f == "latex" = return $ text str
inlineToOrg (RawInline _ _) = return empty
-inlineToOrg (LineBreak) = return cr -- there's no line break in Org
+inlineToOrg (LineBreak) = return (text "\\\\" <> cr)
inlineToOrg Space = return space
inlineToOrg (Link txt (src, _)) = do
case txt of
diff --git a/tests/writer.org b/tests/writer.org
index 85016f352..524d49305 100644
--- a/tests/writer.org
+++ b/tests/writer.org
@@ -42,7 +42,7 @@ item.
Here's one with a bullet. * criminey.
-There should be a hard line break
+There should be a hard line break\\
here.
--------------