@@ -925,6 +925,10 @@ fetchItem sourceURL s =
925925 case parseURIReference' s' of
926926 Just u' -> openURL $ show $ u' `nonStrictRelativeTo` u
927927 Nothing -> openURL s' -- will throw error
928+ (Nothing, s'@('/':'/':_)) -> -- protocol-relative URI
929+ case parseURIReference' s' of
930+ Just u' -> openURL $ show $ u' `nonStrictRelativeTo` httpcolon
931+ Nothing -> openURL s' -- will throw error
928932 (Nothing, s') ->
929933 case parseURI s' of -- requires absolute URI
930934 -- We don't want to treat C:/ as a scheme:
@@ -935,6 +939,11 @@ fetchItem sourceURL s =
935939 where readLocalFile f = do
936940 cont <- BS.readFile f
937941 return (cont, mime)
942+ httpcolon = URI{ uriScheme = "http:",
943+ uriAuthority = Nothing,
944+ uriPath = "",
945+ uriQuery = "",
946+ uriFragment = "" }
938947 dropFragmentAndQuery = takeWhile (\c -> c /= '?' && c /= '#')
939948 fp = unEscapeString $ dropFragmentAndQuery s
940949 mime = case takeExtension fp of