git.iko.soy/typeable/pandoc
on master help sign in
Muse reader: replace `optionMaybe` and `fromMaybe` with `option`
commit6d16ea9c76799e1303dde6cea13406ea62c10439 authorAlexander Krotov <ilabdsf@gmail.com> dateMon 24 Sep 2018, 10:57 (8 years ago) parent4bc2b7e
1 file changed+2−2
src/Text/Pandoc/Readers/Muse.hs+2−2
src/Text/Pandoc/Readers/Muse.hs+2−2
@@ -963,7 +963,7 @@ image :: PandocMonad m => MuseParser m (F Inlines)
963963image = try $ do
964964 string "[["
965965 (url, (ext, width, align)) <- manyUntil (noneOf "]") (imageExtensionAndOptions <* char ']')
966− content <- optionMaybe linkContent
966+ content <- option mempty linkContent
967967 char ']'
968968 let widthAttr = case align of
969969 Just 'f' -> [("width", fromMaybe "100" width ++ "%"), ("height", "75%")]
@@ -973,7 +973,7 @@ image = try $ do
973973 Just 'l' -> ["align-left"]
974974 Just 'f' -> []
975975 _ -> []
976− return $ B.imageWith ("", alignClass, widthAttr) (url ++ ext) mempty <$> fromMaybe (return mempty) content
976+ return $ B.imageWith ("", alignClass, widthAttr) (url ++ ext) mempty <$> content
977977 where -- Taken from muse-image-regexp defined in Emacs Muse file lisp/muse-regexps.el
978978 imageExtensions = [".eps", ".gif", ".jpg", ".jpeg", ".pbm", ".png", ".tiff", ".xbm", ".xpm"]
979979 imageExtension = choice (try . string <$> imageExtensions)