Fix ~ not being escaped

This commit is contained in:
Tim Van Baak 2019-05-18 00:38:22 -07:00
parent 172d1b2123
commit 56766d3ad3
1 changed files with 1 additions and 0 deletions

View File

@ -19,6 +19,7 @@ def titleescape(s):
"""
s = s.strip()
s = re.sub(r"\s+", '_', s) # Replace whitespace with _
s = re.sub(r"~", '_', s) # parse.quote doesn't catch ~
s = parse.quote(s) # Encode all other characters
s = re.sub(r"%", "", s) # Strip encoding %s
s = s[:64] # Limit to 64 characters