Don't print <span> tags in 'plain' output.

This commit is contained in:
John MacFarlane
2013-11-06 09:25:50 -08:00
parent cf0472a4c6
commit 6b24b1afca
+4 -1
View File
@@ -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 <> "*"