From 6b24b1afca306c9149c285b60ed36f04fae2ece2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 6 Nov 2013 09:25:50 -0800 Subject: Don't print `` tags in 'plain' output. --- src/Text/Pandoc/Writers/Markdown.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 56be709d8..eefcd547a 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -642,8 +642,11 @@ escapeSpaces x = x -- | Convert Pandoc inline element to markdown. inlineToMarkdown :: WriterOptions -> Inline -> State WriterState Doc inlineToMarkdown opts (Span attrs ils) = do + st <- get contents <- inlineListToMarkdown opts ils - return $ tagWithAttrs "span" attrs <> contents <> text "" + return $ if stPlain st + then contents + else tagWithAttrs "span" attrs <> contents <> text "" inlineToMarkdown opts (Emph lst) = do contents <- inlineListToMarkdown opts lst return $ "*" <> contents <> "*" -- cgit v1.2.3