mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 16:35:42 +00:00
EPUB writer: Download images at URLs.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user