From 8b01e200f05035424cbedfe1e133d20486238e1f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 1 Dec 2022 19:20:06 -0800 Subject: Multiple input files with --file-scope: fix case where the links are URL-encoded, e.g. with `%20`. Closes #8467. --- src/Text/Pandoc/App/Input.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/App/Input.hs b/src/Text/Pandoc/App/Input.hs index fa9c6cf88..d8308654d 100644 --- a/src/Text/Pandoc/App/Input.hs +++ b/src/Text/Pandoc/App/Input.hs @@ -17,7 +17,7 @@ module Text.Pandoc.App.Input import Control.Monad ((>=>)) import Control.Monad.Except (throwError, catchError) import Data.Text (Text) -import Network.URI (URI (..), parseURI) +import Network.URI (URI (..), parseURI, unEscapeString) import Text.Pandoc.Class ( PandocMonad, openURL , readFileStrict, readStdinStrict, report) import Text.Pandoc.Definition (Pandoc (..), Attr, Block (..), Inline (..)) @@ -172,7 +172,7 @@ adjustLinksAndIds exts thisfile allfiles -- an internal link with the appropriate identifier fixURL :: Text -> Text fixURL u = - let (a,b) = T.break (== '#') u + let (a,b) = T.break (== '#') $ T.pack . unEscapeString . T.unpack $ u filepart = if T.null a then toIdent thisfile else toIdent a -- cgit v1.2.3