Text.Pandoc.Data: store paths in dataFiles using posix separators.
This way we have uniform separators, whether on Windows or Linux. This should solve a problem where on some Windows versions the data files weren't being found. Closes #2459.
This commit is contained in:
parent
34d53aff6e
commit
7f4b78c064
1 changed files with 9 additions and 1 deletions
|
@ -2,6 +2,14 @@
|
|||
-- to be processed using hsb2hs
|
||||
module Text.Pandoc.Data (dataFiles) where
|
||||
import qualified Data.ByteString as B
|
||||
import System.FilePath (splitDirectories)
|
||||
import qualified System.FilePath.Posix as Posix
|
||||
|
||||
-- We ensure that the data files are stored using Posix
|
||||
-- path separators (/), even on Windows.
|
||||
dataFiles :: [(FilePath, B.ByteString)]
|
||||
dataFiles = ("README", %blob "README") : %blobs "data"
|
||||
dataFiles = map (\(fp, contents) ->
|
||||
(Posix.joinPath (splitDirectories fp), contents)) dataFiles'
|
||||
|
||||
dataFiles' :: [(FilePath, B.ByteString)]
|
||||
dataFiles' = ("README", %blob "README") : %blobs "data"
|
||||
|
|
Loading…
Add table
Reference in a new issue