From f3f3638f21a5f9ca1c1933a969bdfc1aef1a2eb4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 11 Jan 2013 17:07:04 -0800 Subject: EPUB writer: Download images at URLs. --- src/Text/Pandoc/Writers/EPUB.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3