Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the SVN-Notify CPAN distribution.

Report information
The Basics
Id: 18429
Status: resolved
Worked: 10 min
Priority: 0/
Queue: SVN-Notify

People
Owner: Nobody in particular
Requestors: ste+cpan [...] junkomatic.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.54
Fixed in: 2.55



Subject: [PATCH] ticket_url not expanded into URL in HTML.pm
The result of the match against the ticket_regex is substituted into the message text correctly but not into the URL href: $2 is accidentally used instead of using $1 a second time. Patch attached.
Subject: HTML.pm.patch
*** lib/SVN/Notify/HTML.pm.orig 2006-03-29 16:20:23.000000000 +0100 --- lib/SVN/Notify/HTML.pm 2006-03-29 16:24:55.000000000 +0100 *************** *** 290,296 **** or die q{Missing "ticket_regex" parameter to accompany } . q{"ticket_url" parameter}; $url = encode_entities($url, '<>&"'); ! $msg =~ s|$regex|sprintf qq{<a href="$url">$1</a>}, $2|ige; } else { --- 290,296 ---- or die q{Missing "ticket_regex" parameter to accompany } . q{"ticket_url" parameter}; $url = encode_entities($url, '<>&"'); ! $msg =~ s|$regex|sprintf qq{<a href="$url">$1</a>}, $1|ige; } else {
Subject: Re: [rt.cpan.org #18429] [PATCH] ticket_url not expanded into URL in HTML.pm
Date: Wed, 29 Mar 2006 08:43:03 -0800
To: bug-SVN-Notify [...] rt.cpan.org
From: David Wheeler <david [...] kineticode.com>
On Mar 29, 2006, at 07:27, via RT wrote: Show quoted text
> The result of the match against the ticket_regex is substituted into > the message text correctly but not into the URL href: $2 is > accidentally used instead of using $1 a second time. Patch attached.
Actually, using $2 was intentional: =item ticket_regex svnnotify --ticket-regex '\[?\s*(Ticket\s*#\s*(\d+))\s*\]?' This attribute is inherited from L<SVN::Notify|SVN::Notify>, but its semantics are slightly different: it should return I<two> matches instead of one: the text to linkify and the ticket ID itself. The example shown matches ("[Ticket#1234]", "1234") or ("[ Ticket # 1234 ]", "1234"). Make your regex as specific as possible, preferably wrapped in "\b" tags and the like. So you want it to return two matches. Best, David
Subject: Re: [rt.cpan.org #18429] [PATCH] ticket_url not expanded into URL in HTML.pm
Date: Thu, 30 Mar 2006 09:11:56 +0100
To: bug-SVN-Notify [...] rt.cpan.org
From: Steve James <steve.james [...] beachsolutions.com>
On Wednesday 29 March 2006 17:43, David Wheeler via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=18429 > > > On Mar 29, 2006, at 07:27, via RT wrote:
> > The result of the match against the ticket_regex is substituted into > > the message text correctly but not into the URL href: $2 is > > accidentally used instead of using $1 a second time. Patch attached.
> > Actually, using $2 was intentional: > > =item ticket_regex > > svnnotify --ticket-regex '\[?\s*(Ticket\s*#\s*(\d+))\s*\]?' > > This attribute is inherited from L<SVN::Notify|SVN::Notify>, but its > semantics > are slightly different: it should return I<two> matches instead of > one: the > text to linkify and the ticket ID itself. The example shown matches > ("[Ticket#1234]", "1234") or ("[ Ticket # 1234 ]", "1234"). Make your > regex as > specific as possible, preferably wrapped in "\b" tags and the like. > > So you want it to return two matches. > > Best, > > David
David, Thanks for the reply. I understand now. RTFM, sorry. Problem was I was only reading the man page for SVN::Notify -- hadn't even occurred to me to look at SVN::Notify::HTML. Oops. Perhaps you might add a hint in the SVN::Notify text against the "--handler HTML" entry to advise the reader to read SVN::Notify::HTML? Thanks, Steve. -- ----------------------------------------------------------------------- Steve James mailto:steve.james@beachsolutions.com Beach Solutions http://www.beachsolutions.com
Subject: Re: [rt.cpan.org #18429] [PATCH] ticket_url not expanded into URL in HTML.pm
Date: Thu, 30 Mar 2006 10:48:20 -0800
To: bug-SVN-Notify [...] rt.cpan.org
From: David Wheeler <david [...] kineticode.com>
On Mar 30, 2006, at 00:12, steve.james@beachsolutions.com via RT wrote: Show quoted text
> Perhaps you might add a hint in the SVN::Notify text against the "-- > handler > HTML" entry to advise the reader to read SVN::Notify::HTML?
Good idea. I've added this sentence to the --handler section: Be sure to read the documentation for your subclass of choice, as there may be additional parameters and existing parameters may behave differently. It will be in the next release. Best, David
Documenation updated in 2.55. Thanks!