@@ -635,12 +635,11 @@ pSpan = try $ do
635635 guardEnabled Ext_native_spans
636636 TagOpen _ attr <- lookAhead $ pSatisfy $ tagOpen (=="span") (const True)
637637 contents <- pInTags "span" inline
638− let attr' = mkAttr attr
639− return $ case attr' of
640− ("",[],[("style",s)])
641− | filter (`notElem` " \t;") s == "font-variant:small-caps" ->
642− B.smallcaps contents
643− _ -> B.spanWith (mkAttr attr) contents
638+ let isSmallCaps = fontVariant == "small-caps"
639+ where styleAttr = fromMaybe "" $ lookup "style" attr
640+ fontVariant = fromMaybe "" $ pickStyleAttrProps ["font-variant"] styleAttr
641+ let tag = if isSmallCaps then B.smallcaps else B.spanWith (mkAttr attr)
642+ return $ tag contents
644643
645644pRawHtmlInline :: TagParser Inlines
646645pRawHtmlInline = do