import { Match, check } from 'meteor/check'; import Logger from '/imports/startup/server/logger'; import { GroupChatMsg } from '/imports/api/group-chat-msg'; import { BREAK_LINE } from '/imports/utils/lineEndings'; import changeHasMessages from '/imports/api/users-persistent-data/server/modifiers/changeHasMessages'; export function parseMessage(message) { let parsedMessage = message || ''; // Replace \r and \n to
parsedMessage = parsedMessage.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, `$1${BREAK_LINE}$2`); // Replace flash links to html valid ones parsedMessage = parsedMessage.split('