@@ -117,7 +117,7 @@ attrsToMarkdown attribs = braces $ hsep [attribId, attribClasses, attribKeys]
117117
118118linkAttributes :: WriterOptions -> Attr -> Doc Text
119119linkAttributes opts attr =
120− if isEnabled Ext_link_attributes opts && attr /= nullAttr
120+ if (isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts) && attr /= nullAttr
121121 then attrsToMarkdown attr
122122 else empty
123123
@@ -394,13 +394,15 @@ inlineToMarkdown opts (Quoted DoubleQuote lst) = do
394394 then "“" <> contents <> "”"
395395 else "“" <> contents <> "”"
396396inlineToMarkdown opts (Code attr str) = do
397− let tickGroups = filter (T.any (== '`')) $ T.group str
398− let longest = maybe 0 maximum $ nonEmpty $ map T.length tickGroups
399− let marker = T.replicate (longest + 1) "`"
400− let spacer = if longest == 0 then "" else " "
401− let attrs = if isEnabled Ext_inline_code_attributes opts && attr /= nullAttr
402− then attrsToMarkdown attr
403− else empty
397+ let tickGroups = filter (T.any (== '`')) $ T.group str
398+ let longest = maybe 0 maximum $ nonEmpty $ map T.length tickGroups
399+ let marker = T.replicate (longest + 1) "`"
400+ let spacer = if longest == 0 then "" else " "
401+ let attrsEnabled = isEnabled Ext_inline_code_attributes opts ||
402+ isEnabled Ext_attributes opts
403+ let attrs = if attrsEnabled && attr /= nullAttr
404+ then attrsToMarkdown attr
405+ else empty
404406 variant <- asks envVariant
405407 case variant of
406408 PlainText -> return $ literal str
@@ -559,7 +561,7 @@ inlineToMarkdown opts lnk@(Link attr txt (src, tit)) = do
559561 else "[" <> reftext <> "]"
560562 in return $ first <> second
561563 | isEnabled Ext_raw_html opts
562− , not (isEnabled Ext_link_attributes opts)
564+ , not (isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts)
563565 , attr /= nullAttr -> -- use raw HTML to render attributes
564566 literal . T.strip <$>
565567 writeHtml5String opts{ writerTemplate = Nothing }
@@ -569,7 +571,7 @@ inlineToMarkdown opts lnk@(Link attr txt (src, tit)) = do
569571 linkAttributes opts attr
570572inlineToMarkdown opts img@(Image attr alternate (source, tit))
571573 | isEnabled Ext_raw_html opts &&
572− not (isEnabled Ext_link_attributes opts) &&
574+ not (isEnabled Ext_link_attributes opts || isEnabled Ext_attributes opts) &&
573575 attr /= nullAttr = -- use raw HTML
574576 literal . T.strip <$>
575577 writeHtml5String opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain [img]])