Skip to content

Commit

Permalink
Really fix #1758. Add id="cover" to body on cover page.
Browse files Browse the repository at this point in the history
Not title page!
  • Loading branch information
John MacFarlane committed Nov 17, 2014
1 parent 91a26fc commit 7a5cb29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data/templates
Submodule templates updated 2 files
+3 −4 default.epub
+3 −4 default.epub3
5 changes: 3 additions & 2 deletions src/Text/Pandoc/Writers/EPUB.hs
Expand Up @@ -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] )
Expand Down

0 comments on commit 7a5cb29

Please sign in to comment.