aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-02-14 22:17:26 -0800
committerJohn MacFarlane <[email protected]>2024-02-14 22:17:26 -0800
commit4b9c78f1ce4c49956dc29cc2eeeadce315ad55fd (patch)
tree80244a98899ad044d609314af2433003b64b17f2 /src
parentb98877270d544df9c070bc82d46a5cdba98105e0 (diff)
PDF: avoid readFileLazy.
My hunch is that this is causing improperly cleaned up temp directory on Windows (#9460), but this will have to be confirmed.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/PDF.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index a684eebd2..ccde52c39 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -58,7 +58,7 @@ import Data.List (intercalate)
#endif
import Data.List (isPrefixOf, find)
import Text.Pandoc.Class (fillMediaBag, getVerbosity, setVerbosity,
- readFileLazy, readFileStrict, fileExists,
+ readFileStrict, fileExists,
report, extractMedia, PandocMonad, runIOorExplode)
import Text.Pandoc.Logging
import Text.DocTemplates ( FromContext(lookupContext) )
@@ -384,7 +384,7 @@ getResultingPDF logFile pdfFile = do
Just logFile' -> do
logExists <- fileExists logFile'
if logExists
- then Just <$> readFileLazy logFile'
+ then Just . BL.fromStrict <$> readFileStrict logFile'
else return Nothing
Nothing -> return Nothing
return (log', pdf)
@@ -424,7 +424,7 @@ runTeXProgram program args tmpDir = do
let logFile = replaceExtension file ".log"
logExists <- fileExists logFile
logContents <- if logExists
- then readFileLazy logFile
+ then BL.fromStrict <$> readFileStrict logFile
else return mempty
let rerunWarnings = checkForRerun logContents
tocHash <- do
@@ -432,7 +432,7 @@ runTeXProgram program args tmpDir = do
tocFileExists <- fileExists tocFile
if tocFileExists
then do
- tocContents <- readFileLazy tocFile
+ tocContents <- BL.fromStrict <$> readFileStrict tocFile
pure $ Just $! sha1 tocContents
else pure Nothing
-- compare hash of toc to former hash to see if it changed (#9295)