diff --git a/scripts/communityScripts/armored-chat/armored_chat.qml b/scripts/communityScripts/armored-chat/armored_chat.qml
index 706d431a95..87c255663f 100644
--- a/scripts/communityScripts/armored-chat/armored_chat.qml
+++ b/scripts/communityScripts/armored-chat/armored_chat.qml
@@ -460,13 +460,8 @@ Rectangle {
function addMessage(username, message, date, channel, type){
channel = getChannel(channel)
- // Linkify
- var regex = /(https?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+(?:\/[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]*)?(?=\s|$)/g;
- message = message.replace(regex, (match) => {
- return "" + match + "";
- });
-
- message = sanatizeContent(message); // Make sure we don't have any nasties
+ // Format content
+ message = formatContent(message);
if (type === "notification"){
channel.append({ text: message, date: date, type: "notification" });
@@ -501,9 +496,16 @@ Rectangle {
return channels[id];
}
- function sanatizeContent(mess) {
+ function formatContent(mess) {
+ var link = /(https?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+(?:\/[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]*)?(?=\s|$)/g;
+ mess = mess.replace(link, () => {return "" + match + ""});
+
var script_tag = /