@@ -428,11 +428,12 @@ inlineToMuse (Image attr inlines (source, title)) = do
428428 then if null inlines
429429 then ""
430430 else "[" <> alt <> "]"
431− else "[" <> text title <> "]"
431+ else "[" <> text (escape title) <> "]"
432432 let width = case dimension Width attr of
433433 Just (Percent x) | isEnabled Ext_amuse opts -> " " ++ show (round x :: Integer)
434434 _ -> ""
435435 return $ "[[" <> text (urlEscapeBrackets source ++ width) <> "]" <> title' <> "]"
436+ where escape s = if "]" `isInfixOf` s then escapeString s else conditionalEscapeString s
436437inlineToMuse (Note contents) = do
437438 -- add to notes in state
438439 notes <- gets stNotes