@@ -312,6 +312,13 @@ replaceSmallCaps :: Inline -> Inline
312312replaceSmallCaps (SmallCaps lst) = Emph lst
313313replaceSmallCaps x = x
314314
315+removeKeyValues :: Inline -> Inline
316+removeKeyValues (Code (i, cls, _) xs) = Code (i, cls, []) xs
317+-- Do not remove attributes from Link
318+-- Do not remove attributes, such as "width", from Image
319+removeKeyValues (Span (i, cls, _) xs) = Span (i, cls, []) xs
320+removeKeyValues x = x
321+
315322normalizeInlineList :: [Inline] -> [Inline]
316323normalizeInlineList (Str "" : xs)
317324 = normalizeInlineList xs
@@ -356,7 +363,7 @@ inlineListToMuse :: PandocMonad m
356363 => [Inline]
357364 -> StateT WriterState m Doc
358365inlineListToMuse lst = do
359− lst' <- normalizeInlineList <$> preprocessInlineList (map replaceSmallCaps lst)
366+ lst' <- normalizeInlineList <$> preprocessInlineList (map (removeKeyValues . replaceSmallCaps) lst)
360367 if null lst'
361368 then pure "<verbatim></verbatim>"
362369 else hcat <$> mapM inlineToMuse (fixNotes lst')