aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorMauro Bieg <mb21@users.noreply.github.com>2018-03-18 19:34:34 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2018-03-18 11:34:34 -0700
commitec47079d3e58821dbf0edde6fde1b40b1279d750 (patch)
treea118de8551560610ce2d808aaf1e340dffa941a0 /src/Text
parent937bec95a970dfef2c7623561b4d0892399523dc (diff)
downloadpandoc-ec47079d3e58821dbf0edde6fde1b40b1279d750.tar.gz
EPUB writer: remove notes from TOC in nav.xhtml (#4463)
fixes #4453
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index e74e5e0c3..8d0a46949 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -751,12 +751,13 @@ pandocToEPUB version opts doc@(Pandoc meta _) = do
(writeHtmlStringForEPUB version
opts{ writerTemplate = Nothing }
(Pandoc nullMeta
- [Plain $ walk delink tit])) of
+ [Plain $ walk clean tit])) of
Left _ -> TS.pack $ stringify tit
Right x -> x
- -- can't have a element inside a...
- delink (Link _ ils _) = Span ("", [], []) ils
- delink x = x
+ -- can't have <a> elements inside generated links...
+ clean (Link _ ils _) = Span ("", [], []) ils
+ clean (Note _) = Str ""
+ clean x = x
let navtag = if epub3 then "nav" else "div"
tocBlocks <- lift $ evalStateT (mapM (navPointNode navXhtmlFormatter) secs) 1