This commit is contained in:
Guillem Hernandez Sola
2026-04-28 14:27:48 +02:00
parent 591a6d9563
commit b36c06b529

View File

@@ -359,7 +359,8 @@ def is_html(text: str) -> bool:
def strip_trailing_url_punctuation(url: str) -> str: def strip_trailing_url_punctuation(url: str) -> str:
if not url: if not url:
return url return url
return re.sub(r"[\s…,\.,;:!?)\]"']+$", "", url.strip()) # Fix the unterminated string literal issue
return re.sub(r"[\s…,\.;:!?)\]'\"]+$", "", url.strip())
def canonicalize_url(url: str): def canonicalize_url(url: str):