diff options
author | mt_caret <mtakeda.enigsol@gmail.com> | 2021-08-04 05:53:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-03 15:53:05 -0600 |
commit | 407de98b5e3971c84c7e89de5f2a9d317b4d4557 (patch) | |
tree | 98f102700b6976ca3a959eb3e667c10f0e859ccf /src/Text/Pandoc/Network | |
parent | 8667ba2bcc8a7da6ba50369161c0bcb9020780e8 (diff) | |
download | pandoc-407de98b5e3971c84c7e89de5f2a9d317b4d4557.tar.gz |
Stop using the HTTP package. (#7456)
We only depend on the urlEncode function in the package, which is also
provided by http-types. The HTTP package also depends on the network
package, which has difficulty building on ghcjs.
Add internal module Text.Pandoc.Network.HTTP, exporting `urlEncode`.
Diffstat (limited to 'src/Text/Pandoc/Network')
-rw-r--r-- | src/Text/Pandoc/Network/HTTP.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Network/HTTP.hs b/src/Text/Pandoc/Network/HTTP.hs new file mode 100644 index 000000000..89f7f5544 --- /dev/null +++ b/src/Text/Pandoc/Network/HTTP.hs @@ -0,0 +1,18 @@ +{- | + Module : Text.Pandoc.Writers.Markdown.Inline + Copyright : Copyright (C) 2006-2021 John MacFarlane + License : GNU GPL, version 2 or above + + Maintainer : John MacFarlane <jgm@berkeley.edu> + Stability : alpha + Portability : portable +-} +module Text.Pandoc.Network.HTTP ( + urlEncode + ) where +import qualified Network.HTTP.Types as HTTP +import qualified Text.Pandoc.UTF8 as UTF8 +import qualified Data.Text as T + +urlEncode :: T.Text -> T.Text +urlEncode = UTF8.toText . HTTP.urlEncode True . UTF8.fromText |