diff --git a/js/battledata.js b/js/battledata.js
index 2b1f4989d..50ba0590e 100644
--- a/js/battledata.js
+++ b/js/battledata.js
@@ -317,13 +317,13 @@ var Tools = {
options.hidestrikethrough ? '$1' : '$1');
// linking of URIs
if (!options.hidelinks) {
- str = str.replace(/(https?\:\/\/[a-z0-9-.]+(\/([^\s]*[^\s?.,])?)?|[a-z0-9]([a-z0-9-\.]*[a-z0-9])?\.(com|org|net|edu|us)((\/([^\s]*[^\s?.,])?)?|\b))/ig, function(uri) {
+ str = str.replace(/(https?\:\/\/[a-z0-9-.]+(\:[0-9]+)?(\/([^\s]*[^\s?.,])?)?|[a-z0-9]([a-z0-9-\.]*[a-z0-9])?\.(com|org|net|edu|us)(\:[0-9]+)?((\/([^\s]*[^\s?.,])?)?|\b))/ig, function(uri) {
// Insert http:// before URIs without a URI scheme specified.
var fulluri = uri.replace(/^([a-z]*[^a-z:])/g, 'http://$1');
var onclick;
var r = new RegExp('^https?://' +
document.location.hostname.replace(/\./g, '\\.') +
- '/([a-zA-Z0-9-]+)$');
+ '(\\:[0-9]+)?/([a-zA-Z0-9-]+)$');
var m = r.exec(fulluri);
if (m) {
onclick = "return selectTab('" + m[1] + "');";
@@ -891,4 +891,3 @@ var Tools = {
return '
';
}
};
-