|
@@ -121,7 +121,7 @@ public class Styliser implements ConfigChangeListener {
|
121
|
121
|
+ "[^" + CODE_HYPERLINK + "]+?)([" + URL_PUNCT + "]?)" + CODE_HYPERLINK;
|
122
|
122
|
|
123
|
123
|
/** The regular expression to use for marking up channels. */
|
124
|
|
- private static final String URL_CHANNEL = "(?i)(?<![^\\s\\+@\\-<>])([#&]" + RESERVED_CHARS + "+)";
|
|
124
|
+ private static final String URL_CHANNEL = "(?i)(?<![^\\s\\+@\\-<>])([\\Q%s\\E]" + RESERVED_CHARS + "+)";
|
125
|
125
|
|
126
|
126
|
/** Whether or not we should style links. */
|
127
|
127
|
private boolean styleLinks;
|
|
@@ -177,8 +177,11 @@ public class Styliser implements ConfigChangeListener {
|
177
|
177
|
int position = 0;
|
178
|
178
|
|
179
|
179
|
String target = doSmilies(doLinks(new String(chars).replaceAll(INTERNAL_CHARS, "")));
|
180
|
|
-
|
181
|
|
- target = target.replaceAll(URL_CHANNEL, CODE_CHANNEL + "$0" + CODE_CHANNEL);
|
|
180
|
+
|
|
181
|
+ final String prefixes = owner.getServer() == null ? "#&"
|
|
182
|
+ : owner.getServer().getChannelPrefixes();
|
|
183
|
+ target = target.replaceAll(String.format(URL_CHANNEL, prefixes),
|
|
184
|
+ CODE_CHANNEL + "$0" + CODE_CHANNEL);
|
182
|
185
|
|
183
|
186
|
attribs.addAttribute("DefaultFontFamily", UIManager.getFont("TextPane.font"));
|
184
|
187
|
|