Bladeren bron

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 jaren geleden
bovenliggende
commit
78ca5a7191

+ 1
- 1
src/com/dmdirc/ui/messages/Styliser.java Bestand weergeven

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

+ 1
- 0
test/com/dmdirc/ui/messages/IntelligentLinkingTest.java Bestand weergeven

@@ -65,6 +65,7 @@ public class IntelligentLinkingTest {
65 65
             {"(foo: 'www.google.com')", "(foo: '~www.google.com~')"},
66 66
             {"foo: www.google.com, bar", "foo: ~www.google.com~, bar"},
67 67
             {"www.google.com?", "~www.google.com~?"},
68
+            {"www.google.com!", "~www.google.com~!"},
68 69
             {"\"foo\" www.google.com \"www.google.com\"",
69 70
                      "\"foo\" ~www.google.com~ \"~www.google.com~\"",
70 71
             },

Laden…
Annuleren
Opslaan