summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-01-11 17:07:04 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-01-11 17:07:04 -0800
commitf3f3638f21a5f9ca1c1933a969bdfc1aef1a2eb4 (patch)
tree28e23401f6b461cc2448211a23cf7e30cb451c5a /src/Text
parent449ddeb53b9bc2ca28deaedf03a4ea78d9e0d53c (diff)
EPUB writer: Download images at URLs.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 8a020002e..20b9f190d 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -107,9 +107,9 @@ writeEPUB opts doc@(Pandoc meta _) = do
Pandoc _ blocks <- bottomUpM
(transformInlines (writerHTMLMathMethod opts') sourceDir picsRef) doc
pics <- readIORef picsRef
- -- TODO make this work with URLs:
- let readPicEntry (oldsrc, newsrc) = readEntry [] oldsrc >>= \e ->
- return e{ eRelativePath = newsrc }
+ let readPicEntry (oldsrc, newsrc) = do
+ (img,_) <- fetchItem sourceDir oldsrc
+ return $ toEntry newsrc epochtime $ B.fromChunks . (:[]) $ img
picEntries <- mapM readPicEntry pics
-- handle fonts