From bd43c0f4c940b755e2d68c7146c7f5201fb181d9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 23 Jan 2011 10:55:56 -0800 Subject: 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. --- src/Text/Pandoc/Writers/Markdown.hs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/Text/Pandoc/Writers/Markdown.hs') 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 -- cgit v1.2.3