mirror of
https://github.com/lingble/chatwoot.git
synced 2026-03-20 03:52:43 +00:00
Chore: Contact Sidebar, conversation cleanup (#908)
- Update sidebar design - Move every contact data to contacts module - Revert go to next conversation feature - Fix issues with new conversation in action cable - Escape HTML content - Broadcast event when conversation.contact changes. Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
8
app/javascript/shared/helpers/HTMLSanitizer.js
Normal file
8
app/javascript/shared/helpers/HTMLSanitizer.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export const escapeHtml = (unsafe = '') => {
|
||||
return unsafe
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
};
|
||||
@@ -1,6 +1,8 @@
|
||||
import { escapeHtml } from './HTMLSanitizer';
|
||||
|
||||
class MessageFormatter {
|
||||
constructor(message) {
|
||||
this.message = message || '';
|
||||
this.message = escapeHtml(message) || '';
|
||||
}
|
||||
|
||||
formatMessage() {
|
||||
|
||||
Reference in New Issue
Block a user