File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import qualified Network.HTTP.Types as HTTP
2020import qualified Text.Pandoc.UTF8 as UTF8
2121import qualified Data.Text as T
2222import qualified Data.Set as Set
23- import Data.Char (isSpace )
23+ import Data.Char (isSpace , isAscii )
2424import Network.URI (URI (uriScheme ), parseURI , escapeURIString )
2525
2626urlEncode :: T. Text -> T. Text
@@ -90,7 +90,9 @@ schemes = Set.fromList
9090-- | Check if the string is a valid URL with a IANA or frequently used but
9191-- unofficial scheme (see @schemes@).
9292isURI :: T. Text -> Bool
93- isURI = maybe False hasKnownScheme . parseURI . T. unpack
93+ isURI =
94+ -- we URI-escape non-ASCII characters because otherwise parseURI will choke:
95+ maybe False hasKnownScheme . parseURI . escapeURIString isAscii . T. unpack
9496 where
9597 hasKnownScheme = (`Set.member` schemes) . T. toLower .
9698 T. filter (/= ' :' ) . T. pack . uriScheme
Original file line number Diff line number Diff line change 1+ ```
2+ % pandoc -t man
3+ SEE ALSO
4+ ========
5+
6+ * [Milk](https://en.wikipedia.org/wiki/Milk)
7+ * [EBNF](https://en.wikipedia.org/wiki/Extended_Backus–Naur_form)
8+ ^D
9+ .SH SEE ALSO
10+ .IP \[bu] 2
11+ Milk (https://en.wikipedia.org/wiki/Milk)
12+ .IP \[bu] 2
13+ EBNF (https://en.wikipedia.org/wiki/Extended_Backus–Naur_form)
14+ ```
You can’t perform that action at this time.
0 commit comments