feat: area admin con editor tiptap, api crud e upload immagini
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import sanitize from 'sanitize-html';
|
||||
|
||||
export function sanitizeHtml(html: string): string {
|
||||
return sanitize(html, {
|
||||
allowedTags: ['h2', 'h3', 'p', 'strong', 'em', 'u', 's', 'ul', 'ol', 'li', 'a', 'img', 'blockquote', 'br', 'hr'],
|
||||
allowedAttributes: { a: ['href', 'rel', 'target'], img: ['src', 'alt'] },
|
||||
allowedSchemes: ['https', 'http', 'mailto'],
|
||||
allowedSchemesAppliedToAttributes: ['href', 'src'],
|
||||
allowProtocolRelative: false,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user