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/app/ui-utils/lib/MessageProperties.js

17 lines
393 B

import GraphemeSplitter from 'grapheme-splitter';
import { emoji } from '../../emoji';
const splitter = new GraphemeSplitter();
export const messageProperties = {
length: (message) => splitter.countGraphemes(message),
messageWithoutEmojiShortnames: (message) => message.replace(/:\w+:/gm, (match) => {
if (emoji.list[match] !== undefined) {
return ' ';
}
return match;
}),
};