Browse Source

Fixes issue 1466 (intelligent linking erroneously stripping )s)


git-svn-id: http://svn.dmdirc.com/trunk@4384 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 16 years ago
parent
commit
01857f0506

+ 2
- 2
src/com/dmdirc/ui/messages/Styliser.java View File

@@ -79,13 +79,13 @@ public final class Styliser {
79 79
     private static final String URL_PUNCT_ILLEGAL = "\"";
80 80
     
81 81
     /** Defines all characters treated as trailing punctuation that're legal in URLs. */
82
-    private static final String URL_PUNCT_LEGAL = "';:!,\\.\\)\\?";
82
+    private static final String URL_PUNCT_LEGAL = "';:!,\\.\\?";
83 83
     
84 84
     /** Defines all trailing punctuation. */
85 85
     private static final String URL_PUNCT = URL_PUNCT_ILLEGAL + URL_PUNCT_LEGAL;
86 86
 
87 87
     /** Defines all characters allowed in URLs that aren't treated as trailing punct. */
88
-    private static final String URL_NOPUNCT = "a-z0-9$\\-_@&\\+\\*\\(=/#%~";
88
+    private static final String URL_NOPUNCT = "a-z0-9$\\-_@&\\+\\*\\(\\)=/#%~";
89 89
 
90 90
     /** Defines all characters allowed in URLs per W3C specs. */
91 91
     private static final String URL_CHARS = "[" + URL_PUNCT_LEGAL + URL_NOPUNCT

+ 2
- 2
test/com/dmdirc/ui/messages/IntelligentLinkingTest.java View File

@@ -75,8 +75,8 @@ public class IntelligentLinkingTest {
75 75
             {"svn+ssh://foo@bar", "~svn+ssh://foo@bar~"},
76 76
             {"/var/web/www.foo.com/bar", "/var/web/www.foo.com/bar"},
77 77
             {"\"foo\" www.google.com \"www.google.com\"",
78
-                     "\"foo\" ~www.google.com~ \"~www.google.com~\"",
79
-            },
78
+                     "\"foo\" ~www.google.com~ \"~www.google.com~\""},
79
+            {"www.example.com/blah(foobar)", "~www.example.com/blah(foobar)~"},
80 80
         };
81 81
 
82 82
         return Arrays.asList(tests);

Loading…
Cancel
Save