The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Rocket.Chat/packages/rocketchat-ui-message/client/renderMessageBody.js

22 lines
552 B

/* global renderMessageBody:true */
import s from 'underscore.string';
renderMessageBody = function(msg) {
msg.html = msg.msg;
if (s.trim(msg.html) !== '') {
msg.html = s.escapeHTML(msg.html);
}
const message = RocketChat.callbacks.run('renderMessage', msg);
console.log(msg);
if (message.tokens && message.tokens.length > 0) {
for (const {token, text} of message.tokens) {
message.html = message.html.replace(token, () => text); // Uses lambda so doesn't need to escape $
}
}
return msg.html;
};
/* exported renderMessageBody */