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.