git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] gitk: exclude common URL delimiters from linkification regex
@ 2020-12-16  6:55 Alex Henrie
  0 siblings, 0 replies; only message in thread
From: Alex Henrie @ 2020-12-16  6:55 UTC (permalink / raw)
  To: paulus, git; +Cc: Alex Henrie

Angle brackets, square brackets, double quotes, and backticks are all
commonly used to delineate URLs in plain text (and should be escaped
when they are actually part of the URL).

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 gitk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gitk b/gitk
index 23d9dd1..fcd6f61 100755
--- a/gitk
+++ b/gitk
@@ -7054,7 +7054,7 @@ proc appendwithlinks {text tags} {
         incr linknum
     }
     set wlinks [regexp -indices -all -inline -line \
-                    {https?://[^[:space:]]+} $text]
+                    {https?://[^[:space:]<>\[\]\"`]+} $text]
     foreach l $wlinks {
         set s2 [lindex $l 0]
         set e2 [lindex $l 1]
-- 
2.29.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-16  6:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16  6:55 [PATCH] gitk: exclude common URL delimiters from linkification regex Alex Henrie

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).