git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: Use span with style for SmallCaps. (#1360)
92bcd8dJohn MacFarlane
src/Text/Pandoc/Writers/Markdown.hs+8−1
@@ -696,7 +696,14 @@ inlineToMarkdown opts (Subscript lst) = do
696 return $ if isEnabled Ext_subscript opts
696 return $ if isEnabled Ext_subscript opts
697 then "~" <> contents <> "~"
697 then "~" <> contents <> "~"
698 else "<sub>" <> contents <> "</sub>"
698 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>"
700inlineToMarkdown opts (Quoted SingleQuote lst) = do
707inlineToMarkdown opts (Quoted SingleQuote lst) = do
701 contents <- inlineListToMarkdown opts lst
708 contents <- inlineListToMarkdown opts lst
702 return $ "‘" <> contents <> "’"
709 return $ "‘" <> contents <> "’"