diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-01-11 15:44:50 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-01-11 15:44:50 -0800 |
commit | acfe1d96ee43ecc0b6908a4f2bceaee0c33a0178 (patch) | |
tree | 71f3a6d532181aea1a4a34c01faa50d61419ead3 | |
parent | 1cc4e7db52e73ecb3facb879ecc95f9eb4f1316f (diff) | |
download | pandoc-acfe1d96ee43ecc0b6908a4f2bceaee0c33a0178.tar.gz |
pandoc.hs: Fix writerSourceDirectory when a URL is provided.
It should be the URL up to the path.
-rw-r--r-- | pandoc.hs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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')) |