diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-11-12 18:57:37 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-11-12 18:57:37 -0800 |
commit | e88daeba11ef9d0382b17df8cf0ed711f0adadb1 (patch) | |
tree | 9174bc0b2c47e89db6b37feef9c68e7e383ff940 /src | |
parent | bf4d9199895091998fd130e0c20551815d07df99 (diff) | |
parent | c2636e61d784e88c4a2c8916fdf564266dd7cabd (diff) | |
download | pandoc-e88daeba11ef9d0382b17df8cf0ed711f0adadb1.tar.gz |
Merge branch 'master' into citeproc
Diffstat (limited to 'src')
-rw-r--r-- | src/pandoc.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs index c8c414a2e..349d86ca2 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -51,7 +51,7 @@ import Text.Pandoc.Biblio #endif import Control.Monad (when, unless, liftM) import Network.HTTP (simpleHTTP, mkRequest, getResponseBody, RequestMethod(..)) -import Network.URI (parseURI, isURI) +import Network.URI (parseURI, isURI, URI(..)) import qualified Data.ByteString.Lazy as B import Data.ByteString.Lazy.UTF8 (toString, fromString) import Codec.Binary.UTF8.String (decodeString, encodeString) @@ -835,8 +835,9 @@ main = do readSources srcs = mapM readSource srcs readSource "-" = UTF8.getContents readSource src = case parseURI src of - Just u -> readURI u - Nothing -> UTF8.readFile src + Just u | uriScheme u `elem` ["http:","https:"] -> + readURI u + _ -> UTF8.readFile src readURI uri = simpleHTTP (mkRequest GET uri) >>= getResponseBody >>= return . toString -- treat all as UTF8 |