diff options
| author | Joseph C. Sible <[email protected]> | 2024-12-14 02:17:42 -0500 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-12-14 17:08:53 -0800 |
| commit | 02347275e2690e731f762ee4e49f6b123a786c4b (patch) | |
| tree | 9f8ac95b16954c98c4a760f11e54065f3e4b9bfb | |
| parent | 48d83b6ffedb052831a10f9c2d66626f2383a1a7 (diff) | |
Use catMaybes instead of building with maybe and (:) one element at a time
| -rw-r--r-- | src/Text/Pandoc/App/OutputSettings.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Text/Pandoc/App/OutputSettings.hs b/src/Text/Pandoc/App/OutputSettings.hs index 256fb5285..f8c27bee4 100644 --- a/src/Text/Pandoc/App/OutputSettings.hs +++ b/src/Text/Pandoc/App/OutputSettings.hs @@ -29,7 +29,7 @@ import Control.Monad.Except (throwError) import Control.Monad.Trans import Data.Char (toLower) import Data.List (find) -import Data.Maybe (fromMaybe) +import Data.Maybe (catMaybes, fromMaybe) import Skylighting (defaultSyntaxMap) import Skylighting.Parser (addSyntaxDefinition, parseSyntaxDefinition) import System.Directory (getCurrentDirectory) @@ -321,10 +321,11 @@ isBinaryFormat s = sandbox' :: (PandocMonad m, MonadIO m) => Opt -> PandocPure a -> m a sandbox' opts = sandbox sandboxedFiles where - sandboxedFiles = maybe id (:) (optReferenceDoc opts) . - maybe id (:) (optEpubMetadata opts) . - maybe id (:) (optEpubCoverImage opts) . - maybe id (:) (optCSL opts) . - maybe id (:) (optCitationAbbreviations opts) $ + sandboxedFiles = catMaybes [ optReferenceDoc opts + , optEpubMetadata opts + , optEpubCoverImage opts + , optCSL opts + , optCitationAbbreviations opts + ] ++ optEpubFonts opts ++ optBibliography opts |
