summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-06-13 23:13:05 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2016-06-13 23:13:05 +0200
commitcf2502de8fb3d208a6b062d38a09cec0f9faba5a (patch)
tree0151808a876204687e6ae6e77a03664b0f0f3f29 /src
parent43382cead2f578be6e1f4a2813165e51e017e2e3 (diff)
Org writer: support arbitrary raw inlines
Org mode allows arbitrary raw inlines ("export snippets" in Emacs parlance) to be included as `@@format:raw foreign format text@@`. Support for this features is added to the Org writer.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Org.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index f87aeca81..79ca37395 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -305,9 +305,10 @@ inlineToOrg (Math t str) = do
return $ if t == InlineMath
then "$" <> text str <> "$"
else "$$" <> text str <> "$$"
-inlineToOrg (RawInline f str) | isRawFormat f =
- return $ text str
-inlineToOrg (RawInline _ _) = return empty
+inlineToOrg (RawInline f@(Format f') str) =
+ return $ if isRawFormat f
+ then text str
+ else "@@" <> text f' <> ":" <> text str <> "@@"
inlineToOrg (LineBreak) = return (text "\\\\" <> cr)
inlineToOrg Space = return space
inlineToOrg SoftBreak = do