We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3e8d352 + fc2cd53 commit babb0cfCopy full SHA for babb0cf
mistune/util.py
@@ -20,7 +20,12 @@ def escape(s, quote=True):
20
21
22
def escape_url(link):
23
- safe = '/#:()*?=%@+,&'
+ safe = (
24
+ ':/?#@' # gen-delims - '[]' (rfc3986)
25
+ '!$&()*+,;=' # sub-delims - "'" (rfc3986)
26
+ '%' # leave already-encoded octets alone
27
+ )
28
+
29
if html is None:
30
return quote(link.encode('utf-8'), safe=safe)
31
return html.escape(quote(html.unescape(link), safe=safe))
0 commit comments