git.iko.soy/typeable/pandoc
on master help sign in
Work around HXT limitation for --syntax-definition with windows drive.

Closes #4836.

commit65614a85bcf54a58e17a551bd9d94f9643674e7b authorJohn MacFarlane <jgm@berkeley.edu> dateWed 31 Oct 2018, 23:37 (8 years ago) parent714e0eb
1 file changed+9−2
src/Text/Pandoc/App.hs+9−2
src/Text/Pandoc/App.hs+9−2
@@ -1101,8 +1101,15 @@ options =
11011101
11021102 , Option "" ["syntax-definition"]
11031103 (ReqArg
1104− (\arg opt -> return opt{ optSyntaxDefinitions = arg :
1105− optSyntaxDefinitions opt })
1104+ (\arg opt -> do
1105+ let tr c d = map (\x -> if x == c then d else x)
1106+ let arg' = case arg of -- see #4836
1107+ -- HXT confuses Windows path with URI
1108+ _:':':'\\':_ ->
1109+ "file:///" ++ tr '\\' '/' arg
1110+ _ -> arg
1111+ return opt{ optSyntaxDefinitions = arg' :
1112+ optSyntaxDefinitions opt })
11061113 "FILE")
11071114 "" -- "Syntax definition (xml) file"
11081115