If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

##channel links don't always get munged correctly

RESOLVED FIXED

Status

Other Applications
ChatZilla
--
minor
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: James Ross, Assigned: Gijs)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [cz-0.9.86])

Attachments

(1 attachment)

2.09 KB, patch
James Ross
: review+
Details | Diff | Splinter Review
(Reporter)

Description

9 years ago
If you stick this through the munger, the 1st and 3rd channels are missing the # in the link:
  ##foo ##foo :) ##foo ##foo

This happens because the start of the channel-link munger is /(?:\s|\W|^) and the \W eats the # before ^ gets a go. The fix I originally came up with was just /(?:^|\s|\W) which is never going to survive if the regexp engine changes.

My new fix is /(?:\s|[^\w#]|^) which also fixes it and isn't as unstable. :)
(Assignee)

Comment 1

8 years ago
(In reply to comment #0)
> If you stick this through the munger, the 1st and 3rd channels are missing the
> # in the link:
>   ##foo ##foo :) ##foo ##foo
> 
> This happens because the start of the channel-link munger is /(?:\s|\W|^) and
> the \W eats the # before ^ gets a go. The fix I originally came up with was
> just /(?:^|\s|\W) which is never going to survive if the regexp engine changes.
> 
> My new fix is /(?:\s|[^\w#]|^) which also fixes it and isn't as unstable. :)

Why is the \s needed? Doesn't [^\w#] already cover whitespace? (same for \W, really)
(Reporter)

Comment 2

8 years ago
If you can show it's unnecessary in testing, feel free to remove it.
(Assignee)

Comment 3

8 years ago
Created attachment 404268 [details] [diff] [review]
Patch

OK, I nuked the \s at least for this one... Seems to work fine. Do you want me to get rid of it for the other regexes, too?
Assignee: rginda → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #404268 - Flags: review?(silver)
(Reporter)

Updated

8 years ago
Attachment #404268 - Flags: review?(silver) → review+
(Reporter)

Comment 4

8 years ago
Sure, remove it from any with the same pattern.
(Assignee)

Comment 5

8 years ago
Checking in mozilla/extensions/irc/xul/content/mungers.js;
/cvsroot/mozilla/extensions/irc/xul/content/mungers.js,v  <--  mungers.js
new revision: 1.22; previous revision: 1.21
done
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.86]
You need to log in before you can comment on or make changes to this bug.