From cf2502de8fb3d208a6b062d38a09cec0f9faba5a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 13 Jun 2016 23:13:05 +0200 Subject: 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. --- src/Text/Pandoc/Writers/Org.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Writers') 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 -- cgit v1.2.3