git.iko.soy/typeable/pandoc
on master help sign in
Muse writer: simplify escaping in inlineToMuse Image{}
commit16104881b34596b39e41d4fd47f3e3af68e575ac authorAlexander Krotov <ilabdsf@gmail.com> dateThu 5 Apr 2018, 13:12 (9 years ago) parent13538ce
1 file changed+1−2
src/Text/Pandoc/Writers/Muse.hs+1−2
src/Text/Pandoc/Writers/Muse.hs+1−2
@@ -506,12 +506,11 @@ inlineToMuse (Image attr inlines (source, title)) = do
506506 then if null inlines
507507 then ""
508508 else "[" <> alt <> "]"
509− else "[" <> text (escape title) <> "]"
509+ else "[" <> text (conditionalEscapeString True title) <> "]"
510510 let width = case dimension Width attr of
511511 Just (Percent x) | isEnabled Ext_amuse opts -> " " ++ show (round x :: Integer)
512512 _ -> ""
513513 return $ "[[" <> text (urlEscapeBrackets source ++ width) <> "]" <> title' <> "]"
514− where escape s = if "]" `isInfixOf` s then escapeString s else conditionalEscapeString True s
515514inlineToMuse (Note contents) = do
516515 -- add to notes in state
517516 notes <- gets stNotes