From 97acf152e06a8371327204f7f18b0dee726539d4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Mar 2019 11:22:21 -0700 Subject: fetchItem: don't treat UNC paths as protocol-relative URLs. These are paths beginning `//?/UNC/...`. Closes #5127. --- src/Text/Pandoc/Class.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index dd0e35deb..9a3f2aa65 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -569,7 +569,8 @@ downloadOrRead s = do case parseURIReference' s' of Just u' -> openURL $ show $ u' `nonStrictRelativeTo` u Nothing -> openURL s' -- will throw error - (Nothing, s'@('/':'/':_)) -> -- protocol-relative URI + (Nothing, s'@('/':'/':c:_)) | c /= '?' -> -- protocol-relative URI + -- we exclude //? because of //?UNC/ on Windows case parseURIReference' s' of Just u' -> openURL $ show $ u' `nonStrictRelativeTo` httpcolon Nothing -> openURL s' -- will throw error -- cgit v1.2.3