aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-04-05 13:12:17 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-04-05 19:49:09 +0300
commit16104881b34596b39e41d4fd47f3e3af68e575ac (patch)
treec44da819132979a41dc6f1478ad5f0bf19863ef9 /src/Text/Pandoc
parent13538ce6eb1e8bf60d556bdfe551f75a89c8bf3d (diff)
downloadpandoc-16104881b34596b39e41d4fd47f3e3af68e575ac.tar.gz
Muse writer: simplify escaping in inlineToMuse Image{}
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Muse.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs
index aae6b3d9d..4986aa8a6 100644
--- a/src/Text/Pandoc/Writers/Muse.hs
+++ b/src/Text/Pandoc/Writers/Muse.hs
@@ -506,12 +506,11 @@ inlineToMuse (Image attr inlines (source, title)) = do
then if null inlines
then ""
else "[" <> alt <> "]"
- else "[" <> text (escape title) <> "]"
+ else "[" <> text (conditionalEscapeString True 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 True s
inlineToMuse (Note contents) = do
-- add to notes in state
notes <- gets stNotes