From 9097ec41a9c333f24fec63085806da392f8108d4 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Wed, 2 Jan 2019 11:24:53 -0800
Subject: [PATCH] EPUB writer: small fixes to nav.xhtml.

* Add 'landmarks' id attribute to the landmarks nav.
* Replace old default CSS removing numbers from ol.toc li
  with new rules that match `nav#toc ol, nav#landmarks ol`.
* We keep the `toc` class on `ol` for backwards compatibility.
---
 data/epub.css                   | 7 ++++---
 src/Text/Pandoc/Writers/EPUB.hs | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/data/epub.css b/data/epub.css
index 34835ced4..742ea7895 100644
--- a/data/epub.css
+++ b/data/epub.css
@@ -10,9 +10,10 @@ h6 { text-align: left; }
 h1.title { }
 h2.author { }
 h3.date { }
-ol.toc { padding: 0; margin-left: 1em; }
-ol.toc li { list-style-type: none; margin: 0; padding: 0; }
+nav#toc ol,
+nav#landmarks ol { padding: 0; margin-left: 1em; }
+nav#toc ol li,
+nav#landmarks ol li { list-style-type: none; margin: 0; padding: 0; }
 a.footnote-ref { vertical-align: super; }
 em, em em em, em em em em em { font-style: italic;}
 em em, em em em em { font-style: normal; }
-
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 93c685ffa..4faaa1631 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -814,6 +814,7 @@ pandocToEPUB version opts doc@(Pandoc meta _) = do
   let landmarks = if epub3
                      then [RawBlock (Format "html") $ ppElement $
                             unode "nav" ! [("epub:type","landmarks")
+                                          ,("id","landmarks")
                                           ,("hidden","hidden")] $
                             [ unode "ol" $
                               [ unode "li"