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

Re: [PATCH] gitweb: make HTML links out of http/https URLs in changelogs

From
Randal L. Schwartz <merlyn@stonehenge.com>
Date
Nov 21, 2006, 23:55 UTC
Message-ID
<86wt5oicdj.fsf@blue.stonehenge.com>
In-Reply-To
<4563777C.4050108@openvz.org>
>>>>> "Kir" == Kir Kolyshkin <kir@openvz.org> writes:

Kir> + # make HTML links out of http(s) URLs Kir> + $line =~ s/(http[s]?:\/\/[^[:space:]\]\)]+)/<a href="\1">\1<\/a>/g;

Perl tip of the day:

On the right side of s///, you want $1, not \1, because \1 accidentally works, but \10 (instead of the proper $10) will give you a control-h. Ick.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
Previous: Jakub NarebskiNext: Petr Baudis
Message 3 of 6 in “gitweb: make HTML links out of http/https URLs in changelogs”
  1. gitweb: make HTML links out of http/https URLs in changelogsKir Kolyshkin, Nov 21, 2006
  2. Jakub NarebskiNov 21, 2006
  3. Randal L. SchwartzNov 21, 2006
  4. Petr BaudisNov 22, 2006
  5. Kir KolyshkinNov 22, 2006
  6. Petr BaudisNov 22, 2006

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.