git.iko.soy/typeable/pandoc
on master help sign in
EPUB writer: Strip out footnotes from toc entries.
commitd97b1fd14cd2b0f96fcf3bcc10cfc2540fbbe624 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 6 Jan 2014, 21:51 (13 years ago) parentba6a26b
1 file changed+6−5
src/Text/Pandoc/Writers/EPUB.hs+6−5
src/Text/Pandoc/Writers/EPUB.hs+6−5
@@ -124,7 +124,12 @@ opfName n = QName n Nothing (Just "opf")
124124
125125plainify :: [Inline] -> String
126126plainify t =
127− trimr $ writePlain def{ writerStandalone = False } $ Pandoc nullMeta [Plain t]
127+ trimr $ writePlain def{ writerStandalone = False }
128+ $ Pandoc nullMeta [Plain $ walk removeNote t]
129+
130+removeNote :: Inline -> Inline
131+removeNote (Note _) = Str ""
132+removeNote x = x
128133
129134getEPUBMetadata :: WriterOptions -> Meta -> IO EPUBMetadata
130135getEPUBMetadata opts meta = do
@@ -397,10 +402,6 @@ writeEPUB opts doc@(Pandoc meta _) = do
397402
398403 let chapters = evalState (toChapters blocks'') []
399404
400− let removeNote :: Inline -> Inline
401− removeNote (Note _) = Str ""
402− removeNote x = x
403−
404405 let chapToEntry :: Int -> Chapter -> Entry
405406 chapToEntry num (Chapter mbnum bs) = mkEntry (showChapter num)
406407 $ renderHtml