PDF: Use / as path separators in tempdir on Windows.
This is needed for texlive. Note that the / is used only in the body of withTempDir, so when the directory is deleted, the original separators will be used. See #1151.
This commit is contained in:
parent
c026c16fa6
commit
5040f3ede0
1 changed files with 11 additions and 3 deletions
|
@ -51,13 +51,21 @@ import Text.Pandoc.Options (WriterOptions(..))
|
||||||
import Text.Pandoc.MIME (extensionFromMimeType)
|
import Text.Pandoc.MIME (extensionFromMimeType)
|
||||||
import Text.Pandoc.Process (pipeProcess)
|
import Text.Pandoc.Process (pipeProcess)
|
||||||
import qualified Data.ByteString.Lazy as BL
|
import qualified Data.ByteString.Lazy as BL
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
import Data.List (intercalate)
|
||||||
|
#endif
|
||||||
|
|
||||||
withTempDir :: String -> (FilePath -> IO a) -> IO a
|
withTempDir :: String -> (FilePath -> IO a) -> IO a
|
||||||
withTempDir =
|
withTempDir f =
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
withTempDirectory "."
|
withTempDirectory "." (f . changePathSeparators)
|
||||||
#else
|
#else
|
||||||
withSystemTempDirectory
|
withSystemTempDirectory f
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
changePathSeparators :: FilePath -> FilePath
|
||||||
|
changePathSeparators = intercalate "/" . splitDirectories
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
makePDF :: String -- ^ pdf creator (pdflatex, lualatex, xelatex)
|
makePDF :: String -- ^ pdf creator (pdflatex, lualatex, xelatex)
|
||||||
|
|
Loading…
Add table
Reference in a new issue