Use different escaping replacement
This commit is contained in:
parent
56766d3ad3
commit
309dc68127
|
@ -19,7 +19,7 @@ def titleescape(s):
|
||||||
"""
|
"""
|
||||||
s = s.strip()
|
s = s.strip()
|
||||||
s = re.sub(r"\s+", '_', s) # Replace whitespace with _
|
s = re.sub(r"\s+", '_', s) # Replace whitespace with _
|
||||||
s = re.sub(r"~", '_', s) # parse.quote doesn't catch ~
|
s = re.sub(r"~", '-', s) # parse.quote doesn't catch ~
|
||||||
s = parse.quote(s) # Encode all other characters
|
s = parse.quote(s) # Encode all other characters
|
||||||
s = re.sub(r"%", "", s) # Strip encoding %s
|
s = re.sub(r"%", "", s) # Strip encoding %s
|
||||||
s = s[:64] # Limit to 64 characters
|
s = s[:64] # Limit to 64 characters
|
||||||
|
|
Loading…
Reference in New Issue