diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Org/Meta.hs | 9 |
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]) |