@@ -41,16 +41,7 @@ import Data.ByteString.Lazy (toChunks)
4141import Data.Text (Text , pack , unpack )
4242import Data.Time (TimeZone , UTCTime )
4343import Data.Unique (hashUnique )
44- import Network.Connection (TLSSettings (.. ))
45- import qualified Network.TLS as TLS
46- import qualified Network.TLS.Extra as TLS
47- import Network.HTTP.Client
48- (httpLbs , responseBody , responseHeaders ,
49- Request (port , host , requestHeaders ), parseRequest , newManager )
50- import Network.HTTP.Client.Internal (addProxy )
51- import Network.HTTP.Client.TLS (mkManagerSettings )
5244import Network.HTTP.Types.Header ( hContentType )
53- import Network.Socket (withSocketsDo )
5445import Network.URI (URI (.. ), parseURI , unEscapeString )
5546import System.Directory (createDirectoryIfMissing )
5647import System.Environment (getEnv )
@@ -83,7 +74,6 @@ import qualified System.FilePath.Glob
8374import qualified System.Random
8475import qualified Text.Pandoc.UTF8 as UTF8
8576import Data.Default (def )
86- import System.X509 (getSystemCertificateStore )
8777#ifndef EMBED_DATA_FILES
8878import qualified Paths_pandoc as Paths
8979#endif
@@ -129,6 +119,9 @@ openURL u
129119 | Just (URI { uriScheme = " data:" ,
130120 uriPath = upath }) <- parseURI (T. unpack u)
131121 = pure $ extractURIData upath
122+ #if defined(wasm32_HOST_ARCH)
123+ | otherwise = error " Text.Pandoc.Class.IO.openURL"
124+ #else
132125 | otherwise = do
133126 let toReqHeader (n, v) = (CI. mk (UTF8. fromText n), UTF8. fromText v)
134127 customHeaders <- map toReqHeader <$> getsCommonState stRequestHeaders
@@ -168,6 +161,7 @@ openURL u
168161 case res of
169162 Right r -> return r
170163 Left e -> throwError $ PandocHttpError u e
164+ #endif
171165
172166-- | Read the lazy ByteString contents from a file path, raising an error on
173167-- failure.
0 commit comments