Skip to content

Commit

Permalink
Update python-mistune to version 2.0.1 / rev 12 via SR 944542
Browse files Browse the repository at this point in the history
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
mcepl authored and bmwiedemann committed Jan 8, 2022
1 parent 2a70c1d commit 445cc0e
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
Binary file modified packages/p/python-mistune/.files
Binary file not shown.
11 changes: 11 additions & 0 deletions packages/p/python-mistune/.rev
Expand Up @@ -106,4 +106,15 @@
<comment></comment>
<requestid>943348</requestid>
</revision>
<revision rev="12" vrev="2">
<srcmd5>5e233adf0afb73b8486f15a9bf0800bb</srcmd5>
<version>2.0.1</version>
<time>1641680585</time>
<user>dimstar_suse</user>
<comment>- Add 295-overagreesive-escape_url.patch make
mistune.util.escape_url less aggressive
(gh#lepture/mistune#295).
</comment>
<requestid>944542</requestid>
</revision>
</revisionlist>
34 changes: 34 additions & 0 deletions packages/p/python-mistune/295-overagreesive-escape_url.patch
@@ -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))
7 changes: 7 additions & 0 deletions packages/p/python-mistune/python-mistune.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jan 6 19:50:25 UTC 2022 - Matej Cepl <mcepl@suse.com>

- Add 295-overagreesive-escape_url.patch make
mistune.util.escape_url less aggressive
(gh#lepture/mistune#295).

-------------------------------------------------------------------
Fri Dec 31 17:09:33 UTC 2021 - Ben Greiner <code@bnavigator.de>

Expand Down
5 changes: 4 additions & 1 deletion packages/p/python-mistune/python-mistune.spec
@@ -1,7 +1,7 @@
#
# spec file
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -27,6 +27,9 @@ License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/lepture/mistune
Source: https://github.com/lepture/%{modname}/archive/refs/tags/v%{version}.tar.gz#/%{modname}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM 295-overagreesive-escape_url.patch gh#lepture/mistune#295 mcepl@suse.com
# Make mistune.util.escape_url less aggressive
Patch0: 295-overagreesive-escape_url.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
Expand Down

0 comments on commit 445cc0e

Please sign in to comment.