Muse writer: simplify escaping in inlineToMuse Image{}
This commit is contained in:
parent
13538ce6eb
commit
16104881b3
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue