summaryrefslogtreecommitdiff
path: root/django/utils/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils/html.py')
-rw-r--r--django/utils/html.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/django/utils/html.py b/django/utils/html.py
index 56435eb7e2..d3b904a822 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -256,8 +256,8 @@ def smart_urlquote(url):
netloc = unquote_quote(netloc)
if query:
- # Separately unquoting key/value, so as to not mix querystring separators
- # included in query values. See #22267.
+ # Separately unquoting key/value, so as to not mix querystring
+ # separators included in query values. See #22267.
query_parts = [
(unquote(q[0]), unquote(q[1]))
for q in parse_qsl(query, keep_blank_values=True)
@@ -352,7 +352,8 @@ class Urlizer:
url = smart_urlquote(html.unescape(middle))
elif len(middle) <= MAX_URL_LENGTH and self.simple_url_2_re.match(middle):
unescaped_middle = html.unescape(middle)
- # RemovedInDjango70Warning: When the deprecation ends, replace with:
+ # RemovedInDjango70Warning: When the deprecation ends, replace
+ # with:
# url = smart_urlquote(f"https://{unescaped_middle}")
protocol = (
"https"
@@ -462,7 +463,8 @@ class Urlizer:
trail_start = len(rstripped)
amount_trailing_semicolons = len(middle) - len(middle.rstrip(";"))
if amp > -1 and amount_trailing_semicolons > 1:
- # Leave up to most recent semicolon as might be an entity.
+ # Leave up to most recent semicolon as might be an
+ # entity.
recent_semicolon = middle[trail_start:].index(";")
middle_semicolon_index = recent_semicolon + trail_start + 1
trail = middle[middle_semicolon_index:] + trail