diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-08-14 10:40:22 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-08-14 16:33:37 -0700 |
| commit | 6625e9655ed2bb0c4bd4dd91b5959a103deab1cb (patch) | |
| tree | e2d1d401da4b820caf21a198254cb3cc4dfae8bc /src/Text/Pandoc/Readers/HTML.hs | |
| parent | 2f5c75132aa55265de6391761fba0d16a8025272 (diff) | |
Use base64 instead of base64-bytestring.
It is supposed to be faster and more standards-compliant.
Diffstat (limited to 'src/Text/Pandoc/Readers/HTML.hs')
| -rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs index 711457312..918951787 100644 --- a/src/Text/Pandoc/Readers/HTML.hs +++ b/src/Text/Pandoc/Readers/HTML.hs @@ -27,7 +27,7 @@ import Control.Applicative ((<|>)) import Control.Monad (guard, msum, mzero, unless, void) import Control.Monad.Except (throwError, catchError) import Control.Monad.Reader (ask, asks, lift, local, runReaderT) -import Data.ByteString.Base64 (encode) +import Data.Text.Encoding.Base64.URL (encodeBase64) import Data.Char (isAlphaNum, isLetter) import Data.Default (Default (..), def) import Data.Foldable (for_) @@ -785,8 +785,7 @@ pSvg = do contents <- many (notFollowedBy (pCloses "svg") >> pAny) closet <- TagClose "svg" <$ (pCloses "svg" <|> eof) let rawText = T.strip $ renderTags' (opent : contents ++ [closet]) - let svgData = "data:image/svg+xml;base64," <> - UTF8.toText (encode $ UTF8.fromText rawText) + let svgData = "data:image/svg+xml;base64," <> encodeBase64 rawText return $ B.imageWith (ident,cls,[]) svgData mempty mempty pCodeWithClass :: PandocMonad m => Text -> Text -> TagParser m Inlines |
