aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-04 22:51:51 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-04 22:51:51 +0100
commit63b568f445513a570121f93ef7ca0ed1cfd924d6 (patch)
tree4d85de7dc4c1f6c2794398fd5522685a22602007
parent67f4360fb8b7dbadf8581a8a9a6f133654f91bab (diff)
downloadpandoc-63b568f445513a570121f93ef7ca0ed1cfd924d6.tar.gz
Changed writerEpubMetadata to a Maybe String.
API change.
-rw-r--r--src/Text/Pandoc/Options.hs4
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
index c00981d5d..38c083dfd 100644
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -173,7 +173,7 @@ data WriterOptions = WriterOptions
, writerHighlightStyle :: Maybe Style -- ^ Style to use for highlighting
-- (Nothing = no highlighting)
, writerSetextHeaders :: Bool -- ^ Use setext headers for levels 1-2 in markdown
- , writerEpubMetadata :: String -- ^ Metadata to include in EPUB
+ , writerEpubMetadata :: Maybe String -- ^ Metadata to include in EPUB
, writerEpubStylesheet :: Maybe String -- ^ EPUB stylesheet specified at command line
, writerEpubFonts :: [FilePath] -- ^ Paths to fonts to embed
, writerEpubChapterLevel :: Int -- ^ Header level for chapters (separate files)
@@ -209,7 +209,7 @@ instance Default WriterOptions where
, writerListings = False
, writerHighlightStyle = Just pygments
, writerSetextHeaders = True
- , writerEpubMetadata = ""
+ , writerEpubMetadata = Nothing
, writerEpubStylesheet = Nothing
, writerEpubFonts = []
, writerEpubChapterLevel = 1
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index d21f7bea1..7e9a20a0c 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -150,7 +150,7 @@ removeNote x = x
getEPUBMetadata :: PandocMonad m => WriterOptions -> Meta -> E m EPUBMetadata
getEPUBMetadata opts meta = do
let md = metadataFromMeta opts meta
- let elts = onlyElems $ parseXML $ writerEpubMetadata opts
+ let elts = maybe [] (onlyElems . parseXML) $ writerEpubMetadata opts
let md' = foldr addMetadataFromXML md elts
let addIdentifier m =
if null (epubIdentifier m)