git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: Use span with style for SmallCaps. (#1360)
commit92bcd8d298a0c66e1a984e3184765e503a0bbc4d authorJohn MacFarlane <jgm@berkeley.edu> dateSun 13 Jul 2014, 15:21 (12 years ago) parent9d10df7
1 file changed+8−1
src/Text/Pandoc/Writers/Markdown.hs+8−1
src/Text/Pandoc/Writers/Markdown.hs+8−1
@@ -696,7 +696,14 @@ inlineToMarkdown opts (Subscript lst) = do
696696 return $ if isEnabled Ext_subscript opts
697697 then "~" <> contents <> "~"
698698 else "<sub>" <> contents <> "</sub>"
699−inlineToMarkdown opts (SmallCaps lst) = inlineListToMarkdown opts lst
699+inlineToMarkdown opts (SmallCaps lst) = do
700+ contents <- inlineListToMarkdown opts lst
701+ st <- get
702+ return $ if stPlain st
703+ then contents
704+ else tagWithAttrs "span"
705+ ("",[],[("style","font-variant:small-caps;")])
706+ <> contents <> text "</span>"
700707inlineToMarkdown opts (Quoted SingleQuote lst) = do
701708 contents <- inlineListToMarkdown opts lst
702709 return $ "‘" <> contents <> "’"