Bug 55130

wrap


git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@486 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2009-10-21 18:02:49 +00:00
parent 430409f7ba
commit b85e9b95c4
1 changed files with 6 additions and 10 deletions

View File

@ -194,10 +194,6 @@ sub quoteUrls {
my $chr1 = chr(1);
$text =~ s/\0/$chr1\0/g;
# If the comment is already wrapped, we should ignore newlines when
# looking for matching regexps. Else we should take them into account.
my $s = $already_wrapped ? qr/\s/ : qr/[[:blank:]]/;
# However, note that adding the title (for buglinks) can affect things
# In particular, attachment matches go before bug titles, so that titles
# with 'attachment 1' don't double match.
@ -268,10 +264,10 @@ sub quoteUrls {
("\0\0" . ($count-1) . "\0\0")
~egmx;
$text =~ s~\b(attachment$s*\#?$s*(\d+))
$text =~ s~\b(attachment\s*\#?\s*(\d+))
~($things[$count++] = get_attachment_link($2, $1)) &&
("\0\0" . ($count-1) . "\0\0")
~egmxi;
~egsxi;
# Current bug ID this comment belongs to
my $current_bugurl = $curr_bugid ? "show_bug.cgi?id=$curr_bugid" : "";
@ -281,14 +277,14 @@ sub quoteUrls {
# Also, we can't use $bug_re?$comment_re? because that will match the
# empty string
my $bug_word = get_term('bug');
my $bug_re = qr/\Q$bug_word\E$s*\#?$s*(\d+)/i;
my $comment_re = qr/comment$s*\#?$s*(\d+)/i;
$text =~ s~\b($bug_re(?:$s*,?$s*$comment_re)?|$comment_re)
my $bug_re = qr/\Q$bug_word\E\s*\#?\s*(\d+)/i;
my $comment_re = qr/comment\s*\#?\s*(\d+)/i;
$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
# depending on which part matched
(defined($2) ? get_bug_link($2, $1, { comment_num => $3 }) :
"<a href=\"$current_bugurl#c$4\">$1</a>")
~egox;
~egsox;
# Old duplicate markers. These don't use $bug_word because they are old
# and were never customizable.