diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-11-06 09:25:50 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-11-06 09:25:50 -0800 |
commit | 6b24b1afca306c9149c285b60ed36f04fae2ece2 (patch) | |
tree | 6682e462a9ca3cc9c70e60df56c720d90262e507 /src/Text/Pandoc/Writers | |
parent | cf0472a4c62e3e11a68152451cde019693271a01 (diff) | |
download | pandoc-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.hs | 5 |
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 <> "*" |