1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-20 07:49:57 +00:00
elk/composables/sanitize.ts
2022-11-21 16:09:18 +01:00

12 lines
297 B
TypeScript

import SanitizeHTML from 'sanitize-html'
export function sanitize(text: string) {
return SanitizeHTML(text, {
allowedAttributes: {
a: ['href', 'name', 'target', 'class'],
span: ['class'],
img: ['src', 'srcset', 'alt', 'title', 'width', 'height', 'loading'],
},
})
}