aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-10-17 22:03:12 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-10-17 22:04:02 -0700
commit7f4b78c06458861624305c5f574df206d82f78c2 (patch)
tree06f2f30ff1804fb0a10e37694462449ecdfe3d88
parent34d53aff6e0237c4934024a413a5b722666cc487 (diff)
downloadpandoc-7f4b78c06458861624305c5f574df206d82f78c2.tar.gz
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.
-rw-r--r--src/Text/Pandoc/Data.hsb10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Data.hsb b/src/Text/Pandoc/Data.hsb
index 3a0bf8ac4..d408bf510 100644
--- a/src/Text/Pandoc/Data.hsb
+++ b/src/Text/Pandoc/Data.hsb
@@ -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" \ No newline at end of file
+dataFiles = map (\(fp, contents) ->
+ (Posix.joinPath (splitDirectories fp), contents)) dataFiles'
+
+dataFiles' :: [(FilePath, B.ByteString)]
+dataFiles' = ("README", %blob "README") : %blobs "data"