@@ -793,13 +793,8 @@ pandocToEPUB version opts doc = do
793793 [("id","toc")]) $
794794 [ unode "h1" ! [("id","toc-title")] $ tocTitle
795795 , unode "ol" ! [("class","toc")] $ tocBlocks ]]
796− let landmarks = if epub3
797− then [RawBlock (Format "html") $ ppElement $
798− unode "nav" ! [("epub:type","landmarks")
799− ,("id","landmarks")
800− ,("hidden","hidden")] $
801− [ unode "ol" $
802− [ unode "li"
796+ let landmarkItems = if epub3
797+ then [ unode "li"
803798 [ unode "a" ! [("href", "text/cover.xhtml")
804799 ,("epub:type", "cover")] $
805800 "Cover"] |
@@ -811,9 +806,15 @@ pandocToEPUB version opts doc = do
811806 "Table of contents"
812807 ] | writerTableOfContents opts
813808 ]
814− ]
809+ else []
810+ let landmarks = if null landmarkItems
811+ then []
812+ else [RawBlock (Format "html") $ ppElement $
813+ unode "nav" ! [("epub:type","landmarks")
814+ ,("id","landmarks")
815+ ,("hidden","hidden")] $
816+ [ unode "ol" landmarkItems ]
815817 ]
816− else []
817818 navData <- lift $ writeHtml opts'{ writerVariables = ("navpage","true"):
818819 cssvars False ++ vars }
819820 (Pandoc (setMeta "title"