Skip to content

Commit

Permalink
fetchItem: don't treat UNC paths as protocol-relative URLs.
Browse files Browse the repository at this point in the history
These are paths beginning `//?/UNC/...`.  Closes #5127.
  • Loading branch information
jgm committed Mar 22, 2019
1 parent b3473df commit 97acf15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Text/Pandoc/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97acf15

Please sign in to comment.