aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-05-07 14:20:42 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-05-07 14:20:42 +0300
commit621e86402339209ea340dd36dfbd3d9eefc28e85 (patch)
tree060c6ad69146920d7b93f24e821f889c69651e36 /src/Text/Pandoc
parent7c0ef683116d0308da91a61b15b5c640b0e81eda (diff)
downloadpandoc-621e86402339209ea340dd36dfbd3d9eefc28e85.tar.gz
Use Data.Maybe.fromMaybe
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Org/Meta.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs
index 938e393bb..965e33d94 100644
--- a/src/Text/Pandoc/Readers/Org/Meta.hs
+++ b/src/Text/Pandoc/Readers/Org/Meta.hs
@@ -50,6 +50,7 @@ import Text.Pandoc.Shared (safeRead)
import Control.Monad (mzero, void, when)
import Data.Char (toLower)
import Data.List (intersperse)
+import Data.Maybe (fromMaybe)
import qualified Data.Map as M
import Network.HTTP (urlEncode)
@@ -191,16 +192,12 @@ parseFormat = try $ replacePlain <|> replaceUrl <|> justAppend
setEmphasisPreChar :: Maybe [Char] -> OrgParserState -> OrgParserState
setEmphasisPreChar csMb st =
- let preChars = case csMb of
- Nothing -> orgStateEmphasisPreChars defaultOrgParserState
- Just cs -> cs
+ let preChars = fromMaybe (orgStateEmphasisPostChars defaultOrgParserState) csMb
in st { orgStateEmphasisPreChars = preChars }
setEmphasisPostChar :: Maybe [Char] -> OrgParserState -> OrgParserState
setEmphasisPostChar csMb st =
- let postChars = case csMb of
- Nothing -> orgStateEmphasisPostChars defaultOrgParserState
- Just cs -> cs
+ let postChars = fromMaybe (orgStateEmphasisPostChars defaultOrgParserState) csMb
in st { orgStateEmphasisPostChars = postChars }
emphChars :: Monad m => OrgParser m (Maybe [Char])