Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update python-mistune to version 2.0.1 / rev 12 via SR 944542
https://build.opensuse.org/request/show/944542 by user mcepl + dimstar_suse - Add 295-overagreesive-escape_url.patch make mistune.util.escape_url less aggressive (gh#lepture/mistune#295).
- Loading branch information
1 parent
2a70c1d
commit 445cc0e
Showing
5 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/p/python-mistune/295-overagreesive-escape_url.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
From fc2cd53d7698e432ab5b250ffac53458263a49e2 Mon Sep 17 00:00:00 2001 | ||
From: Jeff Dairiki <dairiki@dairiki.org> | ||
Date: Thu, 6 Jan 2022 09:30:32 -0800 | ||
Subject: [PATCH] Make mistune.util.escape_url less aggressive | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
This adds ';', '!', and '$' to the set of characters which will be | ||
passed unmolested by escape_url. These are all in RFC 3986 reserved | ||
character list — that is to say: escaping these may change the meaning | ||
of a URL. | ||
--- | ||
mistune/util.py | 7 ++++++- | ||
1 file changed, 6 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/mistune/util.py b/mistune/util.py | ||
index 192f6ef..f99fe37 100644 | ||
--- a/mistune/util.py | ||
+++ b/mistune/util.py | ||
@@ -20,7 +20,12 @@ def escape(s, quote=True): | ||
|
||
|
||
def escape_url(link): | ||
- safe = '/#:()*?=%@+,&' | ||
+ safe = ( | ||
+ ':/?#@' # gen-delims - '[]' (rfc3986) | ||
+ '!$&()*+,;=' # sub-delims - "'" (rfc3986) | ||
+ '%' # leave already-encoded octets alone | ||
+ ) | ||
+ | ||
if html is None: | ||
return quote(link.encode('utf-8'), safe=safe) | ||
return html.escape(quote(html.unescape(link), safe=safe)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters