From 65614a85bcf54a58e17a551bd9d94f9643674e7b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 31 Oct 2018 23:37:37 -0700 Subject: Work around HXT limitation for --syntax-definition with windows drive. Closes #4836. --- src/Text/Pandoc/App.hs | 11 +++++++++-- 1 file 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" -- cgit v1.2.3