summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Markdown.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/Markdown.hs')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 3c0d4cc6d..c2a3a730c 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -75,8 +75,7 @@ plainify = bottomUp go
go (SmallCaps xs) = SmallCaps xs
go (Code s) = Str s
go (Math _ s) = Str s
- go (TeX _) = Str ""
- go (HtmlInline _) = Str ""
+ go (RawInline _ _) = Str ""
go (Link xs _) = SmallCaps xs
go (Image xs _) = SmallCaps $ [Str "["] ++ xs ++ [Str "]"]
go (Cite _ cits) = SmallCaps cits
@@ -206,11 +205,13 @@ blockToMarkdown opts (Para inlines) = do
then text "\\"
else empty
return $ esc <> contents <> blankline
-blockToMarkdown _ (RawHtml str) = do
- st <- get
- if stPlain st
- then return empty
- else return $ text str <> text "\n"
+blockToMarkdown _ (RawBlock f str)
+ | f == "html" || f == "latex" || f == "markdown" = do
+ st <- get
+ if stPlain st
+ then return empty
+ else return $ text str <> text "\n"
+blockToMarkdown _ (RawBlock _ _) = return empty
blockToMarkdown _ HorizontalRule =
return $ blankline <> text "* * * * *" <> blankline
blockToMarkdown opts (Header level inlines) = do
@@ -439,8 +440,9 @@ inlineToMarkdown _ (Math InlineMath str) =
return $ "$" <> text str <> "$"
inlineToMarkdown _ (Math DisplayMath str) =
return $ "$$" <> text str <> "$$"
-inlineToMarkdown _ (TeX str) = return $ text str
-inlineToMarkdown _ (HtmlInline str) = return $ text str
+inlineToMarkdown _ (RawInline f str)
+ | f == "html" || f == "latex" || f == "markdown" = return $ text str
+inlineToMarkdown _ (RawInline _ _) = return empty
inlineToMarkdown opts (LineBreak) = return $
if writerStrictMarkdown opts
then " " <> cr