@@ -719,10 +719,17 @@ pSubscript :: PandocMonad m => TagParser m Inlines
719719pSubscript = pInlinesInTags "sub" B.subscript
720720
721721pSpanLike :: PandocMonad m => TagParser m Inlines
722−pSpanLike = Set.foldr
723− (\tag acc -> acc <|> pInlinesInTags tag (B.spanWith ("",[T.unpack tag],[])))
724− mzero
725− htmlSpanLikeElements
722+pSpanLike =
723+ Set.foldr
724+ (\tagName acc -> acc <|> parseTag tagName)
725+ mzero
726+ htmlSpanLikeElements
727+ where
728+ parseTag tagName = do
729+ TagOpen _ attrs <- pSatisfy $ tagOpenLit tagName (const True)
730+ let (ids, cs, kvs) = mkAttr . toStringAttr $ attrs
731+ content <- mconcat <$> manyTill inline (pCloses tagName <|> eof)
732+ return $ B.spanWith (ids, T.unpack tagName : cs, kvs) content
726733
727734pSmall :: PandocMonad m => TagParser m Inlines
728735pSmall = pInlinesInTags "small" (B.spanWith ("",["small"],[]))