Viewing Issue Advanced Details

ID 0003864 Category [DMDirc] *Unsorted Severity minor
Reproducibility always Date Submitted 2010-03-07 14:22 Last Update 2010-03-07 19:12
Reporter MD87 Assigned To MD87 View Status public
Priority normal Status closed Resolution fixed
Platform Fixed in Version Target Version 0.6.4
Product Version Product Build
Summary 0003864: Channel linking should terminate on commas
Description
Channel linking should terminate on commas
Needs unit test done
Upstream Bug URL

Relationships

Notes

A patchset (1) related to this change has been added to gerrit by Chris Smith

Channel linking improvements for commas

Fixes issue 3864
Unit test for issue 3864

Change-Id: Ie025d404d2d4eb80bc66aa0b7540ae67810907c9
authorChris Smith <chris@dmdirc.com>2010-03-07 14:29:21 (GMT)
committer Gregory Holmes <greg@dmdirc.com>2010-03-07 19:11:29 (GMT)
commit05fa4bf932f1c8b95ee1a82e2c4ac7a95d3da12b (patch) (side-by-side diff)
Channel linking improvements for commas
Fixes issue 3864 Unit test for issue 3864 Change-Id: Ie025d404d2d4eb80bc66aa0b7540ae67810907c9 Reviewed-on: http://gerrit.dmdirc.com/983 Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com> Reviewed-by: Gregory Holmes <greg@dmdirc.com>
-rw-r--r--src/com/dmdirc/ui/messages/Styliser.java4
-rw-r--r--test/com/dmdirc/ui/messages/IntelligentLinkingTest.java1
2 files changed, 3 insertions, 2 deletions
Click to Expand/Collapse
diff src/com/dmdirc/ui/messages/Styliser.java
@@ -81,7 +81,7 @@ public class Styliser implements ConfigChangeListener {
/** Regexp to match characters which shouldn't be used in channel links. */
private static final String RESERVED_CHARS = "[^\\s" + CODE_BOLD + CODE_COLOUR
+ CODE_STOP + CODE_HEXCOLOUR + CODE_FIXED + CODE_ITALIC
- + CODE_UNDERLINE + CODE_CHANNEL + CODE_NICKNAME + CODE_NEGATE + "\"]";
+ + CODE_UNDERLINE + CODE_CHANNEL + CODE_NICKNAME + CODE_NEGATE + "\",]";
/** Defines all characters treated as trailing punctuation that are illegal in URLs. */
private static final String URL_PUNCT_ILLEGAL = "\"";
@@ -125,7 +125,7 @@ public class Styliser implements ConfigChangeListener {
+ HYPERLINK_CHARS + "]+?)([" + URL_PUNCT + "]?)([" + HYPERLINK_CHARS + "])";
/** The regular expression to use for marking up channels. */
- private static final String URL_CHANNEL = "(?i)(?<![^\\s\\+@\\-<>\\(\"'])([\\Q%s\\E]"
+ private static final String URL_CHANNEL = "(?i)(?<![^\\s\\+@\\-<>\\(\"',])([\\Q%s\\E]"
+ RESERVED_CHARS + "+)";
/** Whether or not we should style links. */
Click to Expand/Collapse
diff test/com/dmdirc/ui/messages/IntelligentLinkingTest.java
@@ -109,6 +109,7 @@ public class IntelligentLinkingTest {
{"\"join #test\"", "\"join @#test@\""},
{"'join #test'", "'join @#test@'"},
{"#test.", "@#test@."},
+ {"#test1,#test2,#test3", "@#test1@,@#test2@,@#test3@"},
{"(\"join #test!\")", "(\"join @#test@!\")"},
};

Issue History

Date Modified Username Field Change
2010-03-07 14:22 MD87 New Issue
2010-03-07 14:22 MD87 Status new => assigned
2010-03-07 14:22 MD87 Assigned To => MD87
2010-03-07 14:30 Version Control Checkin
2010-03-07 14:30 Version Control Note Added: 0010173
2010-03-07 14:30 Version Control Status assigned => fix pending
2010-03-07 19:12 MD87 Checkin
2010-03-07 19:12 MD87 Note Added: 0010188
2010-03-07 19:12 MD87 Status fix pending => resolved
2010-03-07 19:12 MD87 Resolution open => fixed
2010-03-07 19:12 MD87 Status resolved => closed
2010-03-07 19:12 MD87 Needs unit test => done