@@ -968,9 +968,13 @@ main = do
968968 return $ Just csl { CSL.styleAbbrevs = abbrevs }
969969 else return Nothing
970970
971− let sourceDir = if null sources
972− then "."
973− else takeDirectory (head sources)
971+ let sourceDir = case sources of
972+ [] -> "."
973+ (x:_) -> case parseURI x of
974+ Just u
975+ | uriScheme u `elem` ["http:","https:"] ->
976+ show u{ uriPath = "", uriQuery = "", uriFragment = "" }
977+ _ -> takeDirectory x
974978
975979 let readerOpts = def{ readerSmart = smart || (texLigatures &&
976980 (laTeXOutput || "context" `isPrefixOf` writerName'))