Client - move input sanitization in utils

This commit is contained in:
Sam
2022-11-16 11:01:31 +01:00
parent 13b944e26f
commit eb57935b58
8 changed files with 113 additions and 28 deletions

View File

@ -0,0 +1,9 @@
import linkifyHtml from 'linkify-html'
import sanitizeHtml from 'sanitize-html'
export const linkifyAndClean = (input: string): string => {
return sanitizeHtml(linkifyHtml(input, { target: '_blank' }), {
allowedTags: ['a'],
disallowedTagsMode: 'escape',
})
}