@@ -48,6 +48,7 @@ import Data.List (intersperse, transpose, isInfixOf)
4848import System.FilePath (takeExtension)
4949import Text.Pandoc.Class (PandocMonad)
5050import Text.Pandoc.Definition
51+import Text.Pandoc.ImageSize
5152import Text.Pandoc.Options
5253import Text.Pandoc.Pretty
5354import Text.Pandoc.Shared
@@ -384,14 +385,18 @@ inlineToMuse (Link _ txt (src, _)) =
384385 isImageUrl = (`elem` imageExtensions) . takeExtension
385386inlineToMuse (Image attr alt (source,'f':'i':'g':':':title)) =
386387 inlineToMuse (Image attr alt (source,title))
387−inlineToMuse (Image _ inlines (source, title)) = do
388+inlineToMuse (Image attr inlines (source, title)) = do
389+ opts <- gets stOptions
388390 alt <- inlineListToMuse inlines
389391 let title' = if null title
390392 then if null inlines
391393 then ""
392394 else "[" <> alt <> "]"
393395 else "[" <> text title <> "]"
394− return $ "[[" <> text source <> "]" <> title' <> "]"
396+ let width = case dimension Width attr of
397+ Just (Percent x) | isEnabled Ext_amuse opts -> " " ++ show (round x :: Integer)
398+ _ -> ""
399+ return $ "[[" <> text (source ++ width) <> "]" <> title' <> "]"
395400inlineToMuse (Note contents) = do
396401 -- add to notes in state
397402 notes <- gets stNotes