aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-12-03 21:39:19 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-12-03 21:39:44 -0800
commit7199d68ba078148ff76a38f2c483da73edd62747 (patch)
tree0d87f60e37cd054bfdb393b069015271023f4b44
parent9c6cc79c11d191c74aae8646279a2b94ae253330 (diff)
downloadpandoc-7199d68ba078148ff76a38f2c483da73edd62747.tar.gz
EPUB writer: include title page in landmarks.
Closes #6919. Note that the toc is also included if `--toc` is specified.
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs9
-rw-r--r--test/command/5986.md3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index eadd1100f..5867b7c80 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -825,7 +825,12 @@ pandocToEPUB version opts doc = do
[ unode "h1" ! [("id","toc-title")] $ tocTitle
, unode "ol" ! [("class","toc")] $ tocBlocks ]]
let landmarkItems = if epub3
- then [ unode "li"
+ then unode "li"
+ [ unode "a" ! [("href",
+ "text/title_page.xhtml")
+ ,("epub:type", "titlepage")] $
+ ("Title Page" :: String) ] :
+ [ unode "li"
[ unode "a" ! [("href", "text/cover.xhtml")
,("epub:type", "cover")] $
("Cover" :: String)] |
@@ -834,7 +839,7 @@ pandocToEPUB version opts doc = do
[ unode "li"
[ unode "a" ! [("href", "#toc")
,("epub:type", "toc")] $
- ("Table of contents" :: String)
+ ("Table of Contents" :: String)
] | writerTableOfContents opts
]
else []
diff --git a/test/command/5986.md b/test/command/5986.md
index e24aebb64..ea0ca70c1 100644
--- a/test/command/5986.md
+++ b/test/command/5986.md
@@ -6,7 +6,8 @@
<p><span id="nav.xhtml"></span></p>
<nav type="landmarks" id="landmarks" hidden="hidden">
<ol>
-<li><a href="#nav.xhtml#toc">Table of contents</a></li>
+<li><a href="text/title_page.xhtml">Title Page</a></li>
+<li><a href="#nav.xhtml#toc">Table of Contents</a></li>
</ol>
</nav>
<p><span id="ch001.xhtml"></span></p>