Org writer - pass through RawInline with format "org".
This commit is contained in:
parent
f8776ed871
commit
f45a8e1d3b
1 changed files with 7 additions and 2 deletions
|
@ -102,6 +102,10 @@ escapeString = escapeStringUsing $
|
|||
, ('\x2026',"...")
|
||||
] ++ backslashEscapes "^_"
|
||||
|
||||
isRawFormat :: Format -> Bool
|
||||
isRawFormat f =
|
||||
f == Format "latex" || f == Format "tex" || f == Format "org"
|
||||
|
||||
-- | Convert Pandoc block element to Org.
|
||||
blockToOrg :: Block -- ^ Block element
|
||||
-> State WriterState Doc
|
||||
|
@ -129,7 +133,7 @@ blockToOrg (Para inlines) = do
|
|||
blockToOrg (RawBlock "html" str) =
|
||||
return $ blankline $$ "#+BEGIN_HTML" $$
|
||||
nest 2 (text str) $$ "#+END_HTML" $$ blankline
|
||||
blockToOrg (RawBlock f str) | f `elem` ["org", "latex", "tex"] =
|
||||
blockToOrg (RawBlock f str) | isRawFormat f =
|
||||
return $ text str
|
||||
blockToOrg (RawBlock _ _) = return empty
|
||||
blockToOrg HorizontalRule = return $ blankline $$ "--------------" $$ blankline
|
||||
|
@ -271,7 +275,8 @@ inlineToOrg (Math t str) = do
|
|||
return $ if t == InlineMath
|
||||
then "$" <> text str <> "$"
|
||||
else "$$" <> text str <> "$$"
|
||||
inlineToOrg (RawInline f str) | f == "tex" || f == "latex" = return $ text str
|
||||
inlineToOrg (RawInline f str) | isRawFormat f =
|
||||
return $ text str
|
||||
inlineToOrg (RawInline _ _) = return empty
|
||||
inlineToOrg (LineBreak) = return (text "\\\\" <> cr)
|
||||
inlineToOrg Space = return space
|
||||
|
|
Loading…
Add table
Reference in a new issue