fix(regex): avoid capturing quotes at the end of url

This commit is contained in:
graelo 2022-12-10 15:21:30 +01:00
parent 5a411e6531
commit ea8b25c2a7

View file

@ -15,7 +15,7 @@ pub(super) const PATTERNS: [(&str, &str); 20] = [
("markdown-url", r"\[[^]]*\]\(([^)]+)\)"),
(
"url",
r"((https?://|git@|git://|ssh://|ftp://|file:///)[^ \(\)\[\]\{\}>]+)",
r#"((https?://|git@|git://|ssh://|ftp://|file:///)[^ '"`\(\)\[\]\{\}>]+)"#,
),
("email", r"\b([A-z0-9._%+-]+@[A-z0-9.-]+\.[A-z]{2,})\b"),
("diff-a", r"--- a/([^ ]+)"),