aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-11-30 19:33:02 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-11-30 19:33:02 -0800
commit37569f30ed35a45b4765e9cd6c408cd167dd3452 (patch)
tree94c9baee71fb1b7445789a90fcf1000571bba873 /src/Text
parent7f09c1834da9f87e7715f5c9dc52f4b730da8f3f (diff)
downloadpandoc-37569f30ed35a45b4765e9cd6c408cd167dd3452.tar.gz
EPUB writer: Add properties attribute to cover-image item for EPUB v3.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 9745db5a0..6e1a391af 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -448,7 +448,12 @@ writeEPUB opts doc@(Pandoc meta _) = do
[("properties","nav") | epub3 ]) $ ()
] ++
map chapterNode (cpgEntry ++ (tpEntry : chapterEntries)) ++
- map pictureNode (cpicEntry ++ picEntries) ++
+ (case cpicEntry of
+ [] -> []
+ (x:_) -> [add_attrs
+ [Attr (unqual "properties") "cover-image" | epub3]
+ (pictureNode x)]) ++
+ map pictureNode picEntries ++
map fontNode fontEntries
, unode "spine" ! [("toc","ncx")] $
case epubCoverImage metadata of