@@ -397,6 +397,10 @@ writeEPUB opts doc@(Pandoc meta _) = do
398 let chapters = evalState (toChapters blocks'') []
398 let chapters = evalState (toChapters blocks'') []
400+ let removeNote :: Inline -> Inline
401+ removeNote (Note _) = Str ""
400 let chapToEntry :: Int -> Chapter -> Entry
404 let chapToEntry :: Int -> Chapter -> Entry
401 chapToEntry num (Chapter mbnum bs) = mkEntry (showChapter num)
405 chapToEntry num (Chapter mbnum bs) = mkEntry (showChapter num)
402 $ renderHtml
406 $ renderHtml
@@ -404,7 +408,9 @@ writeEPUB opts doc@(Pandoc meta _) = do
404 fromMaybe [] mbnum }
408 fromMaybe [] mbnum }
405 $ case bs of
409 $ case bs of
406 (Header _ _ xs : _) ->
410 (Header _ _ xs : _) ->
411+ -- remove notes or we get doubled footnotes
407− Pandoc (setMeta "title" (fromList xs) nullMeta) bs
412+ Pandoc (setMeta "title" (walk removeNote $ fromList xs)
409 Pandoc nullMeta bs
415 Pandoc nullMeta bs