@@ -48,6 +48,7 @@ import Data.List (intersperse, transpose, isInfixOf)
48import System.FilePath (takeExtension)
48import System.FilePath (takeExtension)
49import Text.Pandoc.Class (PandocMonad)
49import Text.Pandoc.Class (PandocMonad)
50import Text.Pandoc.Definition
50import Text.Pandoc.Definition
51+import Text.Pandoc.ImageSize
51import Text.Pandoc.Options
52import Text.Pandoc.Options
52import Text.Pandoc.Pretty
53import Text.Pandoc.Pretty
53import Text.Pandoc.Shared
54import Text.Pandoc.Shared
@@ -384,14 +385,18 @@ inlineToMuse (Link _ txt (src, _)) =
384 isImageUrl = (`elem` imageExtensions) . takeExtension
385 isImageUrl = (`elem` imageExtensions) . takeExtension
385inlineToMuse (Image attr alt (source,'f':'i':'g':':':title)) =
386inlineToMuse (Image attr alt (source,'f':'i':'g':':':title)) =
386 inlineToMuse (Image attr alt (source,title))
387 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
388 alt <- inlineListToMuse inlines
390 alt <- inlineListToMuse inlines
389 let title' = if null title
391 let title' = if null title
390 then if null inlines
392 then if null inlines
392 else "[" <> alt <> "]"
394 else "[" <> alt <> "]"
393 else "[" <> text title <> "]"
395 else "[" <> text title <> "]"
396+ let width = case dimension Width attr of
397+ Just (Percent x) | isEnabled Ext_amuse opts -> " " ++ show (round x :: Integer)
394− return $ "[[" <> text source <> "]" <> title' <> "]"
399+ return $ "[[" <> text (source ++ width) <> "]" <> title' <> "]"
395inlineToMuse (Note contents) = do
400inlineToMuse (Note contents) = do
396 -- add to notes in state
401 -- add to notes in state
397 notes <- gets stNotes
402 notes <- gets stNotes