aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-11-02 20:14:18 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-11-02 20:14:18 -0700
commit76d3c0d028e738b3c63d4bb1d51a360f54645fee (patch)
treec808df170877f544360d7a01c40c0aa2fcefbc9c /src/Text/Pandoc
parent83556239b1240afb2eac596c408d6e791b4de464 (diff)
downloadpandoc-76d3c0d028e738b3c63d4bb1d51a360f54645fee.tar.gz
Fixed a couple validation bugs that affect epub2 also.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 3b4ae8505..70169328e 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -140,7 +140,7 @@ writeEPUB version opts doc@(Pandoc meta _) = do
let chapToEntry :: Int -> [Tag String] -> Entry
chapToEntry num ts = mkEntry (showChapter num)
$ fromStringLazy
- $ renderTemplate [("body",renderTags ts)]
+ $ renderTemplate [("body",renderTags ts), ("pagetitle",show num)]
$ pageTemplate
let chapterEntries = zipWith chapToEntry [1..] chunks
@@ -173,8 +173,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do
Pandoc meta [Plain t]
let plainTitle = plainify $ docTitle meta
let plainAuthors = map plainify $ docAuthors meta
- let plainDate = maybe "" id $ normalizeDate $ stringify $ docDate meta
currentTime <- getCurrentTime
+ let plainDate = maybe (showDateTimeISO8601 currentTime) id
+ $ normalizeDate $ stringify $ docDate meta
let contentsData = fromStringLazy $ ppTopElement $
unode "package" ! [("version", case version of
EPUB2 -> "2.0"