Client - move input sanitization in utils
This commit is contained in:
9
fittrackee_client/src/utils/inputs.ts
Normal file
9
fittrackee_client/src/utils/inputs.ts
Normal 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',
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user