git.iko.soy/typeable/pandoc
on master help sign in
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.

commitcf2502de8fb3d208a6b062d38a09cec0f9faba5a authorAlbert Krewinkel <albert@zeitkraut.de> dateMon 13 Jun 2016, 23:13 (10 years ago) parent43382ce
1 file changed+4−3
src/Text/Pandoc/Writers/Org.hs+4−3
src/Text/Pandoc/Writers/Org.hs+4−3
@@ -305,9 +305,10 @@ inlineToOrg (Math t str) = do
305305 return $ if t == InlineMath
306306 then "$" <> text str <> "$"
307307 else "$$" <> text str <> "$$"
308−inlineToOrg (RawInline f str) | isRawFormat f =
309− return $ text str
310−inlineToOrg (RawInline _ _) = return empty
308+inlineToOrg (RawInline f@(Format f') str) =
309+ return $ if isRawFormat f
310+ then text str
311+ else "@@" <> text f' <> ":" <> text str <> "@@"
311312inlineToOrg (LineBreak) = return (text "\\\\" <> cr)
312313inlineToOrg Space = return space
313314inlineToOrg SoftBreak = do