From 56277bacea73818a7541b60987e5bc877782baab Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Nov 2013 23:40:46 -0800 Subject: EPUB writer: Don't include node for cover.xhtml if no cover! --- src/Text/Pandoc/Writers/EPUB.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 98f043cd8..ef4c7be23 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -267,8 +267,9 @@ writeEPUB opts doc@(Pandoc meta _) = do , unode "guide" $ [ unode "reference" ! [("type","toc"),("title",plainTitle),("href","nav.xhtml")] $ () - , unode "reference" ! - [("type","cover"),("title","Cover"),("href","cover.xhtml")] $ () + ] ++ + [ unode "reference" ! + [("type","cover"),("title","Cover"),("href","cover.xhtml")] $ () | mbCoverImage /= Nothing ] ] let contentsEntry = mkEntry "content.opf" contentsData -- cgit v1.2.3