diff options
| author | John MacFarlane <[email protected]> | 2022-12-01 19:20:06 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-12-01 19:20:06 -0800 |
| commit | 8b01e200f05035424cbedfe1e133d20486238e1f (patch) | |
| tree | 2558ec9c8ad4a188f4d1013bbe79bcdc5d2902fc | |
| parent | ed4bdd059cc6c4b8045b2c4c2c0f8b44d3faa3d6 (diff) | |
Multiple input files with --file-scope:
fix case where the links are URL-encoded, e.g. with `%20`.
Closes #8467.
| -rw-r--r-- | src/Text/Pandoc/App/Input.hs | 4 |
1 files 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 |
