Skip to contentSkip to conversation

gitk: exclude common URL delimiters from linkification regex

PATCH New Alex Henrie 1 participant 1 message Dec 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitk: exclude common URL delimiters from linkification regex

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).

---
 gitk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gitk +1 -1
index 23d9dd1..fcd6f61 100755
@@ -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]
Signature · 1 line
2.29.2