Browse Source

Intelligent linking now includes ! in trailing punct

Fixes issue 1372

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

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

96
     
96
     
97
     /** Regular expression for intelligent handling of trailing punctuation. */
97
     /** Regular expression for intelligent handling of trailing punctuation. */
98
     private static final String URL_INT4 = "(" + CODE_HYPERLINK
98
     private static final String URL_INT4 = "(" + CODE_HYPERLINK
99
-            + "[^" + CODE_HYPERLINK + "]+?)([\\.,?]?)" + CODE_HYPERLINK;
99
+            + "[^" + CODE_HYPERLINK + "]+?)([\\.,?!]?)" + CODE_HYPERLINK;
100
     
100
     
101
     /** The regular expression to use for marking up channels. */
101
     /** The regular expression to use for marking up channels. */
102
     private static final String URL_CHANNEL = "(?i)(?<![^\\s])([#&]" + RESERVED_CHARS + "+)";
102
     private static final String URL_CHANNEL = "(?i)(?<![^\\s])([#&]" + RESERVED_CHARS + "+)";

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

65
             {"(foo: 'www.google.com')", "(foo: '~www.google.com~')"},
65
             {"(foo: 'www.google.com')", "(foo: '~www.google.com~')"},
66
             {"foo: www.google.com, bar", "foo: ~www.google.com~, bar"},
66
             {"foo: www.google.com, bar", "foo: ~www.google.com~, bar"},
67
             {"www.google.com?", "~www.google.com~?"},
67
             {"www.google.com?", "~www.google.com~?"},
68
+            {"www.google.com!", "~www.google.com~!"},
68
             {"\"foo\" www.google.com \"www.google.com\"",
69
             {"\"foo\" www.google.com \"www.google.com\"",
69
                      "\"foo\" ~www.google.com~ \"~www.google.com~\"",
70
                      "\"foo\" ~www.google.com~ \"~www.google.com~\"",
70
             },
71
             },

Loading…
Cancel
Save