Index: openacs-4/packages/chat/chat.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/chat.info,v diff -u -r1.21 -r1.22 --- openacs-4/packages/chat/chat.info 28 Sep 2018 11:44:23 -0000 1.21 +++ openacs-4/packages/chat/chat.info 9 Nov 2018 20:09:40 -0000 1.22 @@ -9,7 +9,7 @@ f t - + Peter Alberer Server based chat with an html and ajax client. 2017-08-06 @@ -18,7 +18,7 @@ Adapted by Tekne 2006/03/01 to replace JAVA server with AJAX; make use of generalized chat class from xotcl-core. 0 - + @@ -31,6 +31,7 @@ + Index: openacs-4/packages/xowiki/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/chat-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/xowiki/tcl/chat-procs.tcl 9 Nov 2018 16:48:36 -0000 1.36 +++ openacs-4/packages/xowiki/tcl/chat-procs.tcl 9 Nov 2018 20:09:40 -0000 1.37 @@ -108,8 +108,14 @@ } } + # get LinkRegex parameter from the chat package + set link_regex [parameter::get_global_value \ + -package_key "chat" \ + -parameter "LinkRegex"] + # small JavaScript library to obtain a portable ajax request object template::head::add_javascript -src urn:ad:js:get-http-object -order 10 + template::head::add_javascript -script "const linkRegex = \"${link_regex}\";" -order 19 template::head::add_javascript -src ${xowiki_path}ajax/chat-common.js -order 20 template::head::add_javascript -src $jspath -order 30 Index: openacs-4/packages/xowiki/www/ajax/chat-common.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ajax/Attic/chat-common.js,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/ajax/chat-common.js 9 Nov 2018 16:48:36 -0000 1.4 +++ openacs-4/packages/xowiki/www/ajax/chat-common.js 9 Nov 2018 20:09:40 -0000 1.5 @@ -3,12 +3,14 @@ var previous_user_id = ""; var current_color = ""; -// Simple function to create links function createLink(text) { - var linkRegex = /(https?:\/\/[^\s]+)/g; - return text.replace(linkRegex, function(url) { - return '' + url + ''; - }) + if (linkRegex != null) { + return text.replace(new RegExp(linkRegex,'g'), function(url) { + return '' + url + ''; + }) + } else { + return text; + } } function renderData(json) {