mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-05 20:02:47 +01:00
8 lines
219 B
TypeScript
8 lines
219 B
TypeScript
import DOMPurify from 'dompurify';
|
|
|
|
const ALLOWED_TAGS = ['br', 'strong', 'em'];
|
|
|
|
export function sanitizeTranslationHtml(html: string): string {
|
|
return DOMPurify.sanitize(html, { ALLOWED_TAGS, ALLOWED_ATTR: [] });
|
|
}
|