aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/pandoc.hs b/pandoc.hs
index c176db078..20278d2d0 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -968,9 +968,13 @@ main = do
return $ Just csl { CSL.styleAbbrevs = abbrevs }
else return Nothing
- let sourceDir = if null sources
- then "."
- else takeDirectory (head sources)
+ let sourceDir = case sources of
+ [] -> "."
+ (x:_) -> case parseURI x of
+ Just u
+ | uriScheme u `elem` ["http:","https:"] ->
+ show u{ uriPath = "", uriQuery = "", uriFragment = "" }
+ _ -> takeDirectory x
let readerOpts = def{ readerSmart = smart || (texLigatures &&
(laTeXOutput || "context" `isPrefixOf` writerName'))