aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-01-06 21:51:11 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-01-06 21:51:11 -0800
commitd97b1fd14cd2b0f96fcf3bcc10cfc2540fbbe624 (patch)
tree688ef2883622aef282f9c3dc416ab25aebd2d39b /src/Text/Pandoc
parentba6a26b25871a3912556f1a17330d2363b3f3db5 (diff)
downloadpandoc-d97b1fd14cd2b0f96fcf3bcc10cfc2540fbbe624.tar.gz
EPUB writer: Strip out footnotes from toc entries.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index d2dd7da2e..a48300939 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -124,7 +124,12 @@ opfName n = QName n Nothing (Just "opf")
plainify :: [Inline] -> String
plainify t =
- trimr $ writePlain def{ writerStandalone = False } $ Pandoc nullMeta [Plain t]
+ trimr $ writePlain def{ writerStandalone = False }
+ $ Pandoc nullMeta [Plain $ walk removeNote t]
+
+removeNote :: Inline -> Inline
+removeNote (Note _) = Str ""
+removeNote x = x
getEPUBMetadata :: WriterOptions -> Meta -> IO EPUBMetadata
getEPUBMetadata opts meta = do
@@ -397,10 +402,6 @@ writeEPUB opts doc@(Pandoc meta _) = do
let chapters = evalState (toChapters blocks'') []
- let removeNote :: Inline -> Inline
- removeNote (Note _) = Str ""
- removeNote x = x
-
let chapToEntry :: Int -> Chapter -> Entry
chapToEntry num (Chapter mbnum bs) = mkEntry (showChapter num)
$ renderHtml