aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-11-17 15:43:40 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-11-17 15:43:40 -0800
commit7a5cb29319e6daae3ed1cf01a966ca3aac6bec22 (patch)
tree3bddfacf86577d85ee00eb4cf093b2ada2a47bc7 /src/Text/Pandoc
parent91a26fcdc4a06f7b647760dca378fa425880367e (diff)
downloadpandoc-7a5cb29319e6daae3ed1cf01a966ca3aac6bec22.tar.gz
Really fix #1758. Add `id="cover"` to body on cover page.
Not title page!
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 456158116..2291c7184 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -358,8 +358,9 @@ writeEPUB opts doc@(Pandoc meta _) = do
Nothing -> return ([],[])
Just img -> do
let coverImage = "media/" ++ takeFileName img
- let cpContent = renderHtml $ writeHtml opts'
- (Pandoc meta [RawBlock (Format "html") $ "<div id=\"cover-image\">\n<img src=\"" ++ coverImage ++ "\" alt=\"cover image\" />\n</div>"])
+ let cpContent = renderHtml $ writeHtml
+ opts'{ writerVariables = ("coverpage","true"):vars }
+ (Pandoc meta [RawBlock (Format "html") $ "<div id=\"cover-image\">\n<img src=\"" ++ coverImage ++ "\" alt=\"cover image\" />\n</div>"])
imgContent <- B.readFile img
return ( [mkEntry "cover.xhtml" cpContent]
, [mkEntry coverImage imgContent] )