diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index fdf3f8b8..987eea08 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -1800,10 +1800,7 @@ class RoomClient { } formatMsg(message) { - if (message.includes(' { if (message.match(/\.(jpeg|jpg|gif|png|tiff|bmp)$/)) @@ -1812,6 +1809,20 @@ class RoomClient { }); } + stripHtml(html) { + let doc = new DOMParser().parseFromString(html, 'text/html'); + return doc.body.textContent || ''; + } + + isHtml(str) { + var a = document.createElement('div'); + a.innerHTML = str; + for (var c = a.childNodes, i = c.length; i--; ) { + if (c[i].nodeType == 1) return true; + } + return false; + } + collectMessages(time, from, msg) { this.chatMessages.push({ time: time,