should be using pair_start/pair_end throughout for
This commit is contained in:
parent
9d846d10e2
commit
b69c9146b2
1 changed files with 2 additions and 2 deletions
|
@ -21,8 +21,8 @@ def url_sanitise(url: str):
|
||||||
# google.com/()) -> google.com/()
|
# google.com/()) -> google.com/()
|
||||||
if url.endswith(pair_end):
|
if url.endswith(pair_end):
|
||||||
if pair_start in url:
|
if pair_start in url:
|
||||||
open_index = url.rfind("(")
|
open_index = url.rfind(pair_start)
|
||||||
other_index = url.rfind(")", 0, len(url)-1)
|
other_index = url.rfind(pair_end, 0, len(url)-1)
|
||||||
if not other_index == -1 and other_index < open_index:
|
if not other_index == -1 and other_index < open_index:
|
||||||
url = url[:-1]
|
url = url[:-1]
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue