git.iko.soy/typeable/pandoc
on master help sign in
Fixed a couple validation bugs that affect epub2 also.
commit76d3c0d028e738b3c63d4bb1d51a360f54645fee authorJohn MacFarlane <fiddlosopher@gmail.com> dateFri 2 Nov 2012, 20:14 (14 years ago) parent8355623
1 file changed+3−2
src/Text/Pandoc/Writers/EPUB.hs+3−2
src/Text/Pandoc/Writers/EPUB.hs+3−2
@@ -140,7 +140,7 @@ writeEPUB version opts doc@(Pandoc meta _) = do
140140 let chapToEntry :: Int -> [Tag String] -> Entry
141141 chapToEntry num ts = mkEntry (showChapter num)
142142 $ fromStringLazy
143− $ renderTemplate [("body",renderTags ts)]
143+ $ renderTemplate [("body",renderTags ts), ("pagetitle",show num)]
144144 $ pageTemplate
145145
146146 let chapterEntries = zipWith chapToEntry [1..] chunks
@@ -173,8 +173,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do
173173 Pandoc meta [Plain t]
174174 let plainTitle = plainify $ docTitle meta
175175 let plainAuthors = map plainify $ docAuthors meta
176− let plainDate = maybe "" id $ normalizeDate $ stringify $ docDate meta
177176 currentTime <- getCurrentTime
177+ let plainDate = maybe (showDateTimeISO8601 currentTime) id
178+ $ normalizeDate $ stringify $ docDate meta
178179 let contentsData = fromStringLazy $ ppTopElement $
179180 unode "package" ! [("version", case version of
180181 EPUB2 -> "2.0"