aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph C. Sible <josephcsible@users.noreply.github.com>2020-02-03 11:26:00 -0500
committerGitHub <noreply@github.com>2020-02-03 08:26:00 -0800
commit6371ec241d63e0faf3a181aa4b08fb32ebb2eff1 (patch)
treece0f6e5e16a80507f7d3e63dee0196ed5a871c6d /src
parent8d6fac1253b26dfbbf7b82c717f3933588ed98b9 (diff)
downloadpandoc-6371ec241d63e0faf3a181aa4b08fb32ebb2eff1.tar.gz
Clean up overcomplicated maybe logic (#6105)
We're using maybe in redundant ways. Remove it altogether in one case and simplify it to fromMaybe in another.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/PDF.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index 0d9d1ab17..bd36f0d33 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -145,18 +145,16 @@ makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do
let args = pdfargs ++ mathArgs ++ concatMap toArgs
[("page-size", getField "papersize" meta')
,("title", getField "title" meta')
- ,("margin-bottom", maybe (Just "1.2in") Just
+ ,("margin-bottom", Just $ fromMaybe "1.2in"
(getField "margin-bottom" meta'))
- ,("margin-top", maybe (Just "1.25in") Just
+ ,("margin-top", Just $ fromMaybe "1.25in"
(getField "margin-top" meta'))
- ,("margin-right", maybe (Just "1.25in") Just
+ ,("margin-right", Just $ fromMaybe "1.25in"
(getField "margin-right" meta'))
- ,("margin-left", maybe (Just "1.25in") Just
+ ,("margin-left", Just $ fromMaybe "1.25in"
(getField "margin-left" meta'))
- ,("footer-html", maybe Nothing Just
- (getField "footer-html" meta'))
- ,("header-html", maybe Nothing Just
- (getField "header-html" meta'))
+ ,("footer-html", getField "footer-html" meta')
+ ,("header-html", getField "header-html" meta')
]
source <- writer opts doc
verbosity <- getVerbosity