git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk: exclude common URL delimiters from linkification regex

From
Alex Henrie <alexhenrie24@gmail.com>
Date
Dec 16, 2020, 06:55 UTC
Message-ID
<20201216065523.12698-1-alexhenrie24@gmail.com>

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
Message 1 of 1 in “gitk: exclude common URL delimiters from linkification regex”
  1. gitk: exclude common URL delimiters from linkification regexAlex Henrie, Dec 16, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.