mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 05:52:38 +02:00
Disallow all text formatting by default.
Removed now redundant <script> filtering. Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>
This commit is contained in:
parent
c6d2e567f6
commit
6cf6e6c9ec
1 changed files with 3 additions and 3 deletions
|
@ -509,12 +509,12 @@ Rectangle {
|
|||
}
|
||||
|
||||
function formatContent(mess) {
|
||||
var arrow = /\</gi
|
||||
mess = mess.replace(arrow, "<");
|
||||
|
||||
var link = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
|
||||
mess = mess.replace(link, (match) => {return "<a onclick='Window.openUrl("+match+")' href='" + match + "'>" + match + "</a> <a onclick='Window.openUrl("+match+")'>⮺</a>"});
|
||||
|
||||
var script_tag = /<script\b[^>]*>/gi;
|
||||
mess = mess.replace(script_tag, "script");
|
||||
|
||||
var newline = /\n/gi;
|
||||
mess = mess.replace(newline, "<br>");
|
||||
return mess
|
||||
|
|
Loading…
Reference in a new issue