summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org/Meta.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2016-08-29 14:10:58 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2016-08-29 14:34:39 +0200
commit0568aa5cad5ca5501dc0565b0e341fc5393f67e2 (patch)
tree319e492bb0f58d50548d4fd7f0b7f2945eff8bae /src/Text/Pandoc/Readers/Org/Meta.hs
parent117d3f4d92d5096cfa51305db6d2fa261ef87d24 (diff)
Org reader: respect `email` export option
The `email` option controls whether the email meta-field should be included in the final markup. Setting `#+OPTIONS: email:nil` will drop the email field from the final meta-data output.
Diffstat (limited to 'src/Text/Pandoc/Readers/Org/Meta.hs')
-rw-r--r--src/Text/Pandoc/Readers/Org/Meta.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Org/Meta.hs b/src/Text/Pandoc/Readers/Org/Meta.hs
index 4d74713d6..a20c25e09 100644
--- a/src/Text/Pandoc/Readers/Org/Meta.hs
+++ b/src/Text/Pandoc/Readers/Org/Meta.hs
@@ -53,8 +53,11 @@ import Network.HTTP ( urlEncode )
metaExport :: OrgParser (F Meta)
metaExport = do
st <- getState
- let withAuthor = extractExportOption exportWithAuthor st
+ let settings = orgStateExportSettings st
+ let withAuthor = exportWithAuthor settings
+ let withEmail = exportWithEmail settings
return $ (if withAuthor then id else removeMeta "author")
+ . (if withEmail then id else removeMeta "email")
<$> orgStateMeta st
removeMeta :: String -> Meta -> Meta
@@ -62,9 +65,6 @@ removeMeta key meta' =
let metaMap = unMeta meta'
in Meta $ M.delete key metaMap
-extractExportOption :: (ExportSettings -> a) -> OrgParserState -> a
-extractExportOption ex = ex . orgStateExportSettings
-
-- | Parse and handle a single line containing meta information
-- The order, in which blocks are tried, makes sure that we're not looking at
-- the beginning of a block, so we don't need to check for it