summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-01-11 09:55:33 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2023-01-11 09:55:33 -0800
commita9a357b5d9dc4f41af72356a682c4d7e20eb14f1 (patch)
tree80f3e008921c6a191945ad3f8d7b6a0854b5296f /src/Text
parent8a2418cc29fba8c4ee4c9dc232450ccbe494dea9 (diff)
Allow `--reference-doc` to take URL argument.
Closes #8535.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs3
-rw-r--r--src/Text/Pandoc/Writers/ODT.hs3
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Output.hs3
3 files changed, 6 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index acefca360..1f69d2fa9 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -134,7 +134,8 @@ writeDocx opts doc = do
P.setUserDataDir oldUserDataDir
let distArchive = toArchive $ BL.fromStrict res
refArchive <- case writerReferenceDoc opts of
- Just f -> toArchive <$> P.readFileLazy f
+ Just f -> toArchive . BL.fromStrict . fst
+ <$> P.fetchItem (T.pack f)
Nothing -> toArchive . BL.fromStrict <$>
readDataFile "reference.docx"
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs
index 7f8a7df2e..3d343d804 100644
--- a/src/Text/Pandoc/Writers/ODT.hs
+++ b/src/Text/Pandoc/Writers/ODT.hs
@@ -94,7 +94,8 @@ pandocToODT opts doc@(Pandoc meta _) = do
lang <- toLang (getLang opts meta)
refArchive <-
case writerReferenceDoc opts of
- Just f -> liftM toArchive $ lift $ P.readFileLazy f
+ Just f -> lift $ toArchive . B.fromStrict . fst <$>
+ (P.fetchItem (T.pack f))
Nothing -> lift $ toArchive . B.fromStrict <$>
readDataFile "reference.odt"
-- handle formulas and pictures
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
index d35930c7b..be7d169ca 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
@@ -578,7 +578,8 @@ presentationToArchive opts meta pres = do
distArchive <- toArchive . BL.fromStrict <$>
readDefaultDataFile "reference.pptx"
refArchive <- case writerReferenceDoc opts of
- Just f -> toArchive <$> P.readFileLazy f
+ Just f -> toArchive . BL.fromStrict . fst
+ <$> P.fetchItem (T.pack f)
Nothing -> toArchive . BL.fromStrict <$>
readDataFile "reference.pptx"