"""Historical evaluation URL comparison, separate from runtime URL security.""" import re MARKDOWN_URL_RE = re.compile(r"\[[^\]]*\]\((https?://[^)]+)\)") def normalize_url(value: str) -> str: value = value.strip() match = MARKDOWN_URL_RE.search(value) if match: value = match.group(1) return value.rstrip("/")