git.iko.soy/typeable/pandoc
on master help sign in
fetchItem: don't treat UNC paths as protocol-relative URLs.

These are paths beginning `//?/UNC/...`. Closes #5127.

commit97acf152e06a8371327204f7f18b0dee726539d4 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 22 Mar 2019, 11:22 (8 years ago) parentb3473df
1 file changed+2−1
src/Text/Pandoc/Class.hs+2−1
src/Text/Pandoc/Class.hs+2−1
@@ -569,7 +569,8 @@ downloadOrRead s = do
569569 case parseURIReference' s' of
570570 Just u' -> openURL $ show $ u' `nonStrictRelativeTo` u
571571 Nothing -> openURL s' -- will throw error
572− (Nothing, s'@('/':'/':_)) -> -- protocol-relative URI
572+ (Nothing, s'@('/':'/':c:_)) | c /= '?' -> -- protocol-relative URI
573+ -- we exclude //? because of //?UNC/ on Windows
573574 case parseURIReference' s' of
574575 Just u' -> openURL $ show $ u' `nonStrictRelativeTo` httpcolon
575576 Nothing -> openURL s' -- will throw error