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/Writers/Markdown | |
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/Writers/Markdown')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown/Inline.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown/Inline.hs b/src/Text/Pandoc/Writers/Markdown/Inline.hs index cd5f5b896..f7a320db3 100644 --- a/src/Text/Pandoc/Writers/Markdown/Inline.hs +++ b/src/Text/Pandoc/Writers/Markdown/Inline.hs @@ -24,7 +24,6 @@ import qualified Data.Map as M import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text as T -import Network.HTTP (urlEncode) import Text.Pandoc.Class.PandocMonad (PandocMonad, report) import Text.Pandoc.Definition import Text.Pandoc.Logging @@ -32,6 +31,7 @@ import Text.Pandoc.Options import Text.Pandoc.Parsing hiding (blankline, blanklines, char, space) import Text.DocLayout import Text.Pandoc.Shared +import Text.Pandoc.Network.HTTP (urlEncode) import Text.Pandoc.Writers.Shared import Text.Pandoc.Walk import Text.Pandoc.Writers.HTML (writeHtml5String) @@ -423,7 +423,7 @@ inlineToMarkdown opts (Str str) = do inlineToMarkdown opts (Math InlineMath str) = case writerHTMLMathMethod opts of WebTeX url -> inlineToMarkdown opts - (Image nullAttr [Str str] (url <> T.pack (urlEncode $ T.unpack str), str)) + (Image nullAttr [Str str] (url <> urlEncode str, str)) _ | isEnabled Ext_tex_math_dollars opts -> return $ "$" <> literal str <> "$" | isEnabled Ext_tex_math_single_backslash opts -> @@ -439,7 +439,7 @@ inlineToMarkdown opts (Math DisplayMath str) = case writerHTMLMathMethod opts of WebTeX url -> (\x -> blankline <> x <> blankline) `fmap` inlineToMarkdown opts (Image nullAttr [Str str] - (url <> T.pack (urlEncode $ T.unpack str), str)) + (url <> urlEncode str, str)) _ | isEnabled Ext_tex_math_dollars opts -> return $ "$$" <> literal str <> "$$" | isEnabled Ext_tex_math_single_backslash opts -> |