git.iko.soy/typeable/pandoc
on master help sign in
EPUB writer: remove notes from TOC in nav.xhtml (#4463)

fixes #4453

commitec47079d3e58821dbf0edde6fde1b40b1279d750 authorMauro Bieg <mb21@users.noreply.github.com> dateSun 18 Mar 2018, 19:34 (9 years ago) parent937bec9
1 file changed+5−4
src/Text/Pandoc/Writers/EPUB.hs+5−4
src/Text/Pandoc/Writers/EPUB.hs+5−4
@@ -751,12 +751,13 @@ pandocToEPUB version opts doc@(Pandoc meta _) = do
751751 (writeHtmlStringForEPUB version
752752 opts{ writerTemplate = Nothing }
753753 (Pandoc nullMeta
754− [Plain $ walk delink tit])) of
754+ [Plain $ walk clean tit])) of
755755 Left _ -> TS.pack $ stringify tit
756756 Right x -> x
757− -- can't have a element inside a...
758− delink (Link _ ils _) = Span ("", [], []) ils
759− delink x = x
757+ -- can't have <a> elements inside generated links...
758+ clean (Link _ ils _) = Span ("", [], []) ils
759+ clean (Note _) = Str ""
760+ clean x = x
760761
761762 let navtag = if epub3 then "nav" else "div"
762763 tocBlocks <- lift $ evalStateT (mapM (navPointNode navXhtmlFormatter) secs) 1