diff --git a/js/jquery-comments.js b/js/jquery-comments.js
index b6c5c7d..2e3325a 100644
--- a/js/jquery-comments.js
+++ b/js/jquery-comments.js
@@ -2232,11 +2232,11 @@
// URLs starting with http://, https://, file:// or ftp://
replacePattern1 = /(^|\s)((https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
- replacedText = inputText.replace(replacePattern1, '$1$2');
+ replacedText = inputText.replace(replacePattern1, '$1$2');
// URLs starting with "www." (without // before it, or it'd re-link the ones done above).
replacePattern2 = /(^|\s)(www\.[\S]+(\b|$))/gim;
- replacedText = replacedText.replace(replacePattern2, '$1$2');
+ replacedText = replacedText.replace(replacePattern2, '$1$2');
// Change email addresses to mailto:: links.
replacePattern3 = /(^|\s)(([a-zA-Z0-9\-\_\.]+)@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;
@@ -2251,7 +2251,7 @@
var splitInput = inputText.split(/(<\/a>)/g);
for (var i = 0; i < splitInput.length; i++) {
if (splitInput[i].match(/$1').replace(replacePattern2, '$1$2').replace(replacePattern3, '$1');
+ splitInput[i] = splitInput[i].replace(replacePattern1, '$1').replace(replacePattern2, '$1$2').replace(replacePattern3, '$1');
}
}
var combinedReplacedText = splitInput.join('');
@@ -2313,4 +2313,4 @@
comments.init(options || {}, this);
});
};
-}));
\ No newline at end of file
+}));