aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Muse.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Writers/Muse.hs')
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index b64756f91..8feb277c6 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -428,11 +428,12 @@ inlineToMuse (Image attr inlines (source, title)) = do
then if null inlines
then ""
else "[" <> alt <> "]"
- else "[" <> text title <> "]"
+ else "[" <> text (escape title) <> "]"
let width = case dimension Width attr of
Just (Percent x) | isEnabled Ext_amuse opts -> " " ++ show (round x :: Integer)
_ -> ""
return $ "[[" <> text (urlEscapeBrackets source ++ width) <> "]" <> title' <> "]"
+ where escape s = if "]" `isInfixOf` s then escapeString s else conditionalEscapeString s
inlineToMuse (Note contents) = do
-- add to notes in state
notes <- gets stNotes