aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-11-06 09:25:50 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-11-06 09:25:50 -0800
commit6b24b1afca306c9149c285b60ed36f04fae2ece2 (patch)
tree6682e462a9ca3cc9c70e60df56c720d90262e507 /src/Text/Pandoc/Writers
parentcf0472a4c62e3e11a68152451cde019693271a01 (diff)
downloadpandoc-6b24b1afca306c9149c285b60ed36f04fae2ece2.tar.gz
Don't print `<span>` tags in 'plain' output.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs5
1 files changed, 4 insertions, 1 deletions
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 "</span>"
+ return $ if stPlain st
+ then contents
+ else tagWithAttrs "span" attrs <> contents <> text "</span>"
inlineToMarkdown opts (Emph lst) = do
contents <- inlineListToMarkdown opts lst
return $ "*" <> contents <> "*"