diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-07-13 15:21:50 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-07-13 15:21:50 -0700 |
commit | 92bcd8d298a0c66e1a984e3184765e503a0bbc4d (patch) | |
tree | 5c1bd06370c4c405b39bc4c38458207dcd24356f /src/Text/Pandoc | |
parent | 9d10df7ff4a15cedbf4020646cafee5120182f07 (diff) | |
download | pandoc-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.hs | 9 |
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 <> "’" |