'pre',
's',
'del',
+ 'section',
+ 'span',
'strong',
'sub',
'sup',
'ul',
],
- ALLOWED_ATTR: ['src', 'width', 'height', 'href', 'alt', 'title'],
+ ALLOWED_ATTR: ['src', 'width', 'height', 'href', 'alt', 'title', 'style' ],
};
-export const sanitizeHTML = (dirtyInput: string): string => {
- console.log('dirty------', dirtyInput);
+export const sanitizeHTML = (dirtyString: string): string => DOMPurify.sanitize(dirtyString, domPurifyConfig);
- const clean = DOMPurify.sanitize(dirtyInput, domPurifyConfig);
-
- console.log('clean------', clean);
-
- return clean;
-};