@@ -906,7 +906,12 @@ inlineToMarkdown opts (Cite (c:cs) lst)
906906 return $ pdoc <+> r
907907 modekey SuppressAuthor = "-"
908908 modekey _ = ""
909−inlineToMarkdown opts (Link attr txt (src, tit)) = do
909+inlineToMarkdown opts lnk@(Link attr txt (src, tit))
910+ | isEnabled Ext_raw_html opts &&
911+ not (isEnabled Ext_link_attributes opts) &&
912+ attr /= nullAttr = -- use raw HTML
913+ return $ text $ trim $ writeHtmlString def $ Pandoc nullMeta [Plain [lnk]]
914+ | otherwise = do
910915 plain <- gets stPlain
911916 linktext <- inlineListToMarkdown opts txt
912917 let linktitle = if null tit
@@ -940,7 +945,12 @@ inlineToMarkdown opts (Link attr txt (src, tit)) = do
940945 else "[" <> linktext <> "](" <>
941946 text src <> linktitle <> ")" <>
942947 linkAttributes opts attr
943−inlineToMarkdown opts (Image attr alternate (source, tit)) = do
948+inlineToMarkdown opts img@(Image attr alternate (source, tit))
949+ | isEnabled Ext_raw_html opts &&
950+ not (isEnabled Ext_link_attributes opts) &&
951+ attr /= nullAttr = -- use raw HTML
952+ return $ text $ trim $ writeHtmlString def $ Pandoc nullMeta [Plain [img]]
953+ | otherwise = do
944954 plain <- gets stPlain
945955 let txt = if null alternate || alternate == [Str source]
946956 -- to prevent autolinks