From 407de98b5e3971c84c7e89de5f2a9d317b4d4557 Mon Sep 17 00:00:00 2001 From: mt_caret Date: Wed, 4 Aug 2021 05:53:05 +0800 Subject: 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`. --- src/Text/Pandoc/Network/HTTP.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/Text/Pandoc/Network/HTTP.hs (limited to 'src/Text/Pandoc/Network') 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 + 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 -- cgit v1.2.3