aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-09-24 10:57:45 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-09-24 10:57:45 +0300
commit6d16ea9c76799e1303dde6cea13406ea62c10439 (patch)
tree3842c591521578bceb806150437cdf19aa5a7d8f
parent4bc2b7eb5b9e71eef141c3b5022fc3cd18560a80 (diff)
downloadpandoc-6d16ea9c76799e1303dde6cea13406ea62c10439.tar.gz
Muse reader: replace `optionMaybe` and `fromMaybe` with `option`
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index e8e309115..e5b0f5f33 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -963,7 +963,7 @@ image :: PandocMonad m => MuseParser m (F Inlines)
image = try $ do
string "[["
(url, (ext, width, align)) <- manyUntil (noneOf "]") (imageExtensionAndOptions <* char ']')
- content <- optionMaybe linkContent
+ content <- option mempty linkContent
char ']'
let widthAttr = case align of
Just 'f' -> [("width", fromMaybe "100" width ++ "%"), ("height", "75%")]
@@ -973,7 +973,7 @@ image = try $ do
Just 'l' -> ["align-left"]
Just 'f' -> []
_ -> []
- return $ B.imageWith ("", alignClass, widthAttr) (url ++ ext) mempty <$> fromMaybe (return mempty) content
+ return $ B.imageWith ("", alignClass, widthAttr) (url ++ ext) mempty <$> content
where -- Taken from muse-image-regexp defined in Emacs Muse file lisp/muse-regexps.el
imageExtensions = [".eps", ".gif", ".jpg", ".jpeg", ".pbm", ".png", ".tiff", ".xbm", ".xpm"]
imageExtension = choice (try . string <$> imageExtensions)