diff --git a/src/core/js/ext_cosmetics.js b/src/core/js/ext_cosmetics.js
index 5d1ac8ee203efd8e6b5fe9efaa7e6f109bed3b29..aeb88cc9763ccc48dc01f0a25670fb67cf471198 100644
--- a/src/core/js/ext_cosmetics.js
+++ b/src/core/js/ext_cosmetics.js
@@ -68,7 +68,10 @@ var cosmetics = new function () {
      * @returns {string} text with <a> elements instead of raw links
      */
     function linkify_string(text) {
-        const match_url_regex = /https?:\/\/[^\s]*\b(?![,:;?!])/gi;
+        // const match_url_regex = /https?:\/\/[^\s]*/g // original
+        // https://regexr.com helps you design regex
+        const match_url_regex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.?[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g
+
         return text.replace(match_url_regex, function (href) {
             var link_text = href;
             if (_link_cut_off_length > 4 && link_text.length > _link_cut_off_length) {