aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Markdown.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-23 10:55:56 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-26 17:22:53 -0800
commitbd43c0f4c940b755e2d68c7146c7f5201fb181d9 (patch)
tree502cab13026c8a3263387ae4578cbf5e7fc6a2b7 /src/Text/Pandoc/Writers/Markdown.hs
parent5bee388914283825491bc1256162f9744743d976 (diff)
downloadpandoc-bd43c0f4c940b755e2d68c7146c7f5201fb181d9.tar.gz
Bumped version to 1.8; depend on pandoc-types 1.8.
The old TeX, HtmlInline and RawHtml elements have been removed and replaced by generic RawInline and RawBlock elements. All modules updated to use the new raw elements.
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