diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-01-11 17:07:04 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-01-11 17:07:04 -0800 |
commit | f3f3638f21a5f9ca1c1933a969bdfc1aef1a2eb4 (patch) | |
tree | 28e23401f6b461cc2448211a23cf7e30cb451c5a | |
parent | 449ddeb53b9bc2ca28deaedf03a4ea78d9e0d53c (diff) | |
download | pandoc-f3f3638f21a5f9ca1c1933a969bdfc1aef1a2eb4.tar.gz |
EPUB writer: Download images at URLs.
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 6 |
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 |