You are viewing a plain text version of this content. The canonical link for it is here.
Posted to infrastructure-issues@apache.org by "Konstantin Kolinko (JIRA)" <ji...@apache.org> on 2014/06/03 22:30:05 UTC

[jira] [Created] (INFRA-7862) Hilite r123456 as links when followed by comma or ')'.

Konstantin Kolinko created INFRA-7862:
-----------------------------------------

             Summary: Hilite r123456 as links when followed by comma or ')'.
                 Key: INFRA-7862
                 URL: https://issues.apache.org/jira/browse/INFRA-7862
             Project: Infrastructure
          Issue Type: Improvement
          Components: Bugzilla
            Reporter: Konstantin Kolinko
            Priority: Minor


Look at the following issue as an example:
https://issues.apache.org/bugzilla/show_bug.cgi?id=56582

I want the text such as "r1599385, " and "r1599395)" to be converted into links to ViewVC. Currently they are displayed as plain text.

Looking into /infrastructure/bugzilla/bugzilla/ and searching for places that use "svn_url" configuration parameter,  I think the following file is responsible for this feature:
 Bugzilla/Template.pm

It contains the following regexp:
>    # Subversion revision links of the form r123456
>    $text =~ s~\b((?<!-|\.)r(\d+))(?=\.?($|\s))

I interpret it [1] as
- World boundary
- "(?<!pattern)" is a zero-width negative look-behind assertion
 that previous character is not '-' or '.'.
- "r" + digits are captured as $1
- digits are captured as $2
- "(?=pattern)" is a zero-width positive look-ahead assertion
 that the text is followed by optional '.' followed by either end-of-line or whitespace.

I propose to change the look-ahead part of that regexp to be the following:
(?=(\.|\,)?($|\s|\)))

That should mean:
- optional point or comma followed by either end-of-line, whitespace or ')'.

There is also similar regular expression in Bugzilla/BugMail.pm, but as I have never seen e-mails with such links from Bugzilla, I think that BugMail.pm is not worth being changed. Changing BugMail.pm would also be more risky, as e-mails are archived, as opposed to on-line display.

[1] http://perldoc.perl.org/perlre.html



--
This message was sent by Atlassian JIRA
(v6.2#6252)