Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
71d84962
Commit
71d84962
authored
Dec 29, 2012
by
Koosha Khajeh Moogahi
Committed by
Frédéric Buclin
Dec 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 804343: Implement autolinkification for a list of comment ids
r/a=LpSolit
parent
fe4e7df6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
Template.pm
Bugzilla/Template.pm
+15
-1
variables.none.tmpl
template/en/default/global/variables.none.tmpl
+2
-0
No files found.
Bugzilla/Template.pm
View file @
71d84962
...
@@ -236,7 +236,8 @@ sub quoteUrls {
...
@@ -236,7 +236,8 @@ sub quoteUrls {
# empty string
# empty string
my $bug_word = template_var('terms')->{bug};
my $bug_word = template_var('terms')->{bug};
my $bug_re = qr/\Q$bug_word\E\s*\#?\s*(\d+)/i;
my $bug_re = qr/\Q$bug_word\E\s*\#?\s*(\d+)/i;
my $comment_re = qr/comment\s*\#?\s*(\d+)/i;
my $comment_word = template_var('terms')->{comment};
my $comment_re = qr/(?:\Q$comment_word\E|comment)\s*\#?\s*(\d+)/i;
$text =~ s~\b($bug_re(?:\s*,?\s*$comment_re)?|$comment_re)
$text =~ s~\b($bug_re(?:\s*,?\s*$comment_re)?|$comment_re)
~ # We have several choices. $1 here is the link, and $2-4 are set
~ # We have several choices. $1 here is the link, and $2-4 are set
# depending on which part matched
# depending on which part matched
...
@@ -261,6 +262,19 @@ sub quoteUrls {
...
@@ -261,6 +262,19 @@ sub quoteUrls {
substr
(
$text
,
$offset
,
$length
)
=
$match
;
substr
(
$text
,
$offset
,
$length
)
=
$match
;
}
}
my
$comments_word
=
template_var
(
'terms'
)
->
{
comments
};
my
$comments_re
=
qr/(?:comments|\Q$comments_word\E)\s*\#?\s*
\d+(?:\s*,\s*\#?\s*\d+)+/
ix
;
while
(
$text
=~
m/($comments_re)/go
)
{
my
$offset
=
$-
[
0
];
my
$length
=
$+
[
0
]
-
$-
[
0
];
my
$match
=
$1
;
$match
=~
s
|
((?:
#\s*)?(\d+))|<a href="$current_bugurl#c$2">$1</a>|g;
substr
(
$text
,
$offset
,
$length
)
=
$match
;
}
# Old duplicate markers. These don't use $bug_word because they are old
# Old duplicate markers. These don't use $bug_word because they are old
# and were never customizable.
# and were never customizable.
$text
=~
s
~
(?
<=^\*\*\*\
This
\
bug
\
has
\
been
\
marked
\
as
\
a
\
duplicate
\
of
\
)
$text
=~
s
~
(?
<=^\*\*\*\
This
\
bug
\
has
\
been
\
marked
\
as
\
a
\
duplicate
\
of
\
)
...
...
template/en/default/global/variables.none.tmpl
View file @
71d84962
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
"ABug" => "A Bug",
"ABug" => "A Bug",
"bugs" => "bugs",
"bugs" => "bugs",
"Bugs" => "Bugs",
"Bugs" => "Bugs",
"comment" => "comment",
"comments" => "comments",
"zeroSearchResults" => "Zarro Boogs found",
"zeroSearchResults" => "Zarro Boogs found",
"Bugzilla" => "Bugzilla"
"Bugzilla" => "Bugzilla"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment