aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-07-13 15:21:50 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-07-13 15:21:50 -0700
commit92bcd8d298a0c66e1a984e3184765e503a0bbc4d (patch)
tree5c1bd06370c4c405b39bc4c38458207dcd24356f /src/Text/Pandoc
parent9d10df7ff4a15cedbf4020646cafee5120182f07 (diff)
downloadpandoc-92bcd8d298a0c66e1a984e3184765e503a0bbc4d.tar.gz
Markdown writer: Use span with style for SmallCaps. (#1360)
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 0acfe870d..2028bf593 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -696,7 +696,14 @@ inlineToMarkdown opts (Subscript lst) = do
return $ if isEnabled Ext_subscript opts
then "~" <> contents <> "~"
else "<sub>" <> contents <> "</sub>"
-inlineToMarkdown opts (SmallCaps lst) = inlineListToMarkdown opts lst
+inlineToMarkdown opts (SmallCaps lst) = do
+ contents <- inlineListToMarkdown opts lst
+ st <- get
+ return $ if stPlain st
+ then contents
+ else tagWithAttrs "span"
+ ("",[],[("style","font-variant:small-caps;")])
+ <> contents <> text "</span>"
inlineToMarkdown opts (Quoted SingleQuote lst) = do
contents <- inlineListToMarkdown opts lst
return $ "‘" <> contents <> "’"