From 86d4da994a2e8a091aea325d9738f3b99ab4dbca Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 11 Aug 2014 14:48:10 -0700 Subject: EPUB reader: use walk instead of bottomUp. This should be more efficient. --- src/Text/Pandoc/Readers/EPUB.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/EPUB.hs b/src/Text/Pandoc/Readers/EPUB.hs index d4eef3556..052d7b832 100644 --- a/src/Text/Pandoc/Readers/EPUB.hs +++ b/src/Text/Pandoc/Readers/EPUB.hs @@ -11,7 +11,6 @@ module Text.Pandoc.Readers.EPUB import Text.XML.Light import Text.Pandoc.Definition hiding (Attr) import Text.Pandoc.Walk (walk, query) -import Text.Pandoc.Generic(bottomUp) import Text.Pandoc.Readers.HTML (readHtml) import Text.Pandoc.Options ( ReaderOptions(..), readerTrace) import Text.Pandoc.Shared (escapeURI, collapseFilePath, addMetaField) @@ -59,7 +58,7 @@ archiveToEPUB os archive = do spine <- parseSpine items content let escapedSpine = map (escapeURI . takeFileName . fst) spine Pandoc _ bs <- - foldM' (\a b -> ((a <>) . bottomUp (prependHash escapedSpine)) + foldM' (\a b -> ((a <>) . walk (prependHash escapedSpine)) `liftM` parseSpineElem root b) mempty spine let ast = coverDoc <> (Pandoc meta bs) let mediaBag = fetchImages (M.elems items) root archive ast -- cgit v1.2.3