Переглянути джерело

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>
tags/0.6.4rc1
Chris Smith 14 роки тому
джерело
коміт
05fa4bf932

+ 2
- 2
src/com/dmdirc/ui/messages/Styliser.java Переглянути файл

81
     /** Regexp to match characters which shouldn't be used in channel links. */
81
     /** Regexp to match characters which shouldn't be used in channel links. */
82
     private static final String RESERVED_CHARS = "[^\\s" + CODE_BOLD + CODE_COLOUR
82
     private static final String RESERVED_CHARS = "[^\\s" + CODE_BOLD + CODE_COLOUR
83
             + CODE_STOP + CODE_HEXCOLOUR + CODE_FIXED + CODE_ITALIC
83
             + CODE_STOP + CODE_HEXCOLOUR + CODE_FIXED + CODE_ITALIC
84
-            + CODE_UNDERLINE + CODE_CHANNEL + CODE_NICKNAME + CODE_NEGATE + "\"]";
84
+            + CODE_UNDERLINE + CODE_CHANNEL + CODE_NICKNAME + CODE_NEGATE + "\",]";
85
     
85
     
86
     /** Defines all characters treated as trailing punctuation that are illegal in URLs. */
86
     /** Defines all characters treated as trailing punctuation that are illegal in URLs. */
87
     private static final String URL_PUNCT_ILLEGAL = "\"";
87
     private static final String URL_PUNCT_ILLEGAL = "\"";
125
             + HYPERLINK_CHARS + "]+?)([" + URL_PUNCT + "]?)([" + HYPERLINK_CHARS + "])";
125
             + HYPERLINK_CHARS + "]+?)([" + URL_PUNCT + "]?)([" + HYPERLINK_CHARS + "])";
126
     
126
     
127
     /** The regular expression to use for marking up channels. */
127
     /** The regular expression to use for marking up channels. */
128
-    private static final String URL_CHANNEL = "(?i)(?<![^\\s\\+@\\-<>\\(\"'])([\\Q%s\\E]"
128
+    private static final String URL_CHANNEL = "(?i)(?<![^\\s\\+@\\-<>\\(\"',])([\\Q%s\\E]"
129
             + RESERVED_CHARS + "+)";
129
             + RESERVED_CHARS + "+)";
130
     
130
     
131
     /** Whether or not we should style links. */
131
     /** Whether or not we should style links. */

+ 1
- 0
test/com/dmdirc/ui/messages/IntelligentLinkingTest.java Переглянути файл

109
             {"\"join #test\"", "\"join @#test@\""},
109
             {"\"join #test\"", "\"join @#test@\""},
110
             {"'join #test'", "'join @#test@'"},
110
             {"'join #test'", "'join @#test@'"},
111
             {"#test.", "@#test@."},
111
             {"#test.", "@#test@."},
112
+            {"#test1,#test2,#test3", "@#test1@,@#test2@,@#test3@"},
112
             {"(\"join #test!\")", "(\"join @#test@!\")"},
113
             {"(\"join #test!\")", "(\"join @#test@!\")"},
113
         };
114
         };
114
 
115
 

Завантаження…
Відмінити
Зберегти