Text.Pandoc.PDF: Fix changePathSeparators
for Windows.
Previously a path beginning with a drive, like `C:\foo\bar`, was translated to `C:\/foo/bar`, which caused problems. With this fix, the backslashes are removed. Closes #6173.
This commit is contained in:
parent
79907e5f17
commit
f8225140a5
1 changed files with 4 additions and 1 deletions
|
@ -60,7 +60,10 @@ import Text.Pandoc.Logging
|
|||
|
||||
#ifdef _WINDOWS
|
||||
changePathSeparators :: FilePath -> FilePath
|
||||
changePathSeparators = intercalate "/" . splitDirectories
|
||||
changePathSeparators =
|
||||
-- We filter out backslashes because an initial `C:\` gets
|
||||
-- retained by `splitDirectories`, see #6173:
|
||||
intercalate "/" . map (filter (/='\\')) . splitDirectories
|
||||
#endif
|
||||
|
||||
makePDF :: String -- ^ pdf creator (pdflatex, lualatex, xelatex,
|
||||
|
|
Loading…
Add table
Reference in a new issue