From ea8b25c2a7797b089836b87745a7ff21ab4b6fbe Mon Sep 17 00:00:00 2001 From: graelo Date: Sat, 10 Dec 2022 15:21:30 +0100 Subject: [PATCH] fix(regex): avoid capturing quotes at the end of url --- src/textbuf/regexes.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textbuf/regexes.rs b/src/textbuf/regexes.rs index d5f5095..2c2dc5e 100644 --- a/src/textbuf/regexes.rs +++ b/src/textbuf/regexes.rs @@ -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/([^ ]+)"),