diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-31 23:37:37 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-31 23:37:37 -0700 |
commit | 65614a85bcf54a58e17a551bd9d94f9643674e7b (patch) | |
tree | cbcc8f1aa617eac9e459d40beb850eeda87d4fe4 | |
parent | 714e0eb83433cc319ac5fe3eaa570ae2c3c80fdc (diff) | |
download | pandoc-65614a85bcf54a58e17a551bd9d94f9643674e7b.tar.gz |
Work around HXT limitation for --syntax-definition with windows drive.
Closes #4836.
-rw-r--r-- | src/Text/Pandoc/App.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 2fb7c92db..5775f6a6c 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -1101,8 +1101,15 @@ options = , Option "" ["syntax-definition"] (ReqArg - (\arg opt -> return opt{ optSyntaxDefinitions = arg : - optSyntaxDefinitions opt }) + (\arg opt -> do + let tr c d = map (\x -> if x == c then d else x) + let arg' = case arg of -- see #4836 + -- HXT confuses Windows path with URI + _:':':'\\':_ -> + "file:///" ++ tr '\\' '/' arg + _ -> arg + return opt{ optSyntaxDefinitions = arg' : + optSyntaxDefinitions opt }) "FILE") "" -- "Syntax definition (xml) file" |