Fix remaining slashes not being converted into text and made % be converted

This commit is contained in:
Fireblade 2025-01-08 08:50:22 -05:00
parent f1ab1c2b69
commit 1f22cda9be

View file

@ -115,7 +115,9 @@ def handle_url(u: re.Match[str]) -> str:
url = url.replace("?", " question-mark ")
url = url.replace("=", " equals ")
url = url.replace("&", " ampersand ")
url = url.replace("%", " percent ")
url = url.replace(":", " colon ") # Handle any remaining colons
url = url.replace("/", " slash ") # Handle any remaining slashes
# Clean up extra spaces
return re.sub(r'\s+', ' ', url).strip()