git.iko.soy/typeable/pandoc
on master help sign in
Changed writerEpubMetadata to a Maybe String.

API change.

commit63b568f445513a570121f93ef7ca0ed1cfd924d6 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 4 Feb 2017, 22:51 (10 years ago) parent67f4360
2 files changed+3−3
src/Text/Pandoc/Options.hs+2−2 src/Text/Pandoc/Writers/EPUB.hs+1−1
src/Text/Pandoc/Options.hs+2−2
@@ -173,7 +173,7 @@ data WriterOptions = WriterOptions
173173 , writerHighlightStyle :: Maybe Style -- ^ Style to use for highlighting
174174 -- (Nothing = no highlighting)
175175 , writerSetextHeaders :: Bool -- ^ Use setext headers for levels 1-2 in markdown
176− , writerEpubMetadata :: String -- ^ Metadata to include in EPUB
176+ , writerEpubMetadata :: Maybe String -- ^ Metadata to include in EPUB
177177 , writerEpubStylesheet :: Maybe String -- ^ EPUB stylesheet specified at command line
178178 , writerEpubFonts :: [FilePath] -- ^ Paths to fonts to embed
179179 , writerEpubChapterLevel :: Int -- ^ Header level for chapters (separate files)
@@ -209,7 +209,7 @@ instance Default WriterOptions where
209209 , writerListings = False
210210 , writerHighlightStyle = Just pygments
211211 , writerSetextHeaders = True
212− , writerEpubMetadata = ""
212+ , writerEpubMetadata = Nothing
213213 , writerEpubStylesheet = Nothing
214214 , writerEpubFonts = []
215215 , writerEpubChapterLevel = 1
src/Text/Pandoc/Writers/EPUB.hs+1−1
@@ -150,7 +150,7 @@ removeNote x = x
150150getEPUBMetadata :: PandocMonad m => WriterOptions -> Meta -> E m EPUBMetadata
151151getEPUBMetadata opts meta = do
152152 let md = metadataFromMeta opts meta
153− let elts = onlyElems $ parseXML $ writerEpubMetadata opts
153+ let elts = maybe [] (onlyElems . parseXML) $ writerEpubMetadata opts
154154 let md' = foldr addMetadataFromXML md elts
155155 let addIdentifier m =
156156 if null (epubIdentifier m)