@@ -428,11 +428,12 @@ inlineToMuse (Image attr inlines (source, title)) = do
428 then if null inlines
428 then if null inlines
430 else "[" <> alt <> "]"
430 else "[" <> alt <> "]"
431− else "[" <> text title <> "]"
431+ else "[" <> text (escape title) <> "]"
432 let width = case dimension Width attr of
432 let width = case dimension Width attr of
433 Just (Percent x) | isEnabled Ext_amuse opts -> " " ++ show (round x :: Integer)
433 Just (Percent x) | isEnabled Ext_amuse opts -> " " ++ show (round x :: Integer)
435 return $ "[[" <> text (urlEscapeBrackets source ++ width) <> "]" <> title' <> "]"
435 return $ "[[" <> text (urlEscapeBrackets source ++ width) <> "]" <> title' <> "]"
436+ where escape s = if "]" `isInfixOf` s then escapeString s else conditionalEscapeString s
436inlineToMuse (Note contents) = do
437inlineToMuse (Note contents) = do
437 -- add to notes in state
438 -- add to notes in state
438 notes <- gets stNotes
439 notes <- gets stNotes