From 2f8dec0fb875d629f7627ab3586e1c99b87bf165 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Mon, 27 Jul 2026 11:35:54 +0330 Subject: [PATCH] fix(sanitize): update comments for ALLOWED_TAGS to clarify synchronization with composer.py --- lib/sanitize.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sanitize.js b/lib/sanitize.js index 7dc0500..8646c31 100644 --- a/lib/sanitize.js +++ b/lib/sanitize.js @@ -3,6 +3,10 @@ import DOMPurify from "isomorphic-dompurify"; export function sanitizeHtml(html) { if (!html || typeof html !== "string") return ""; + // ⚠️ ALLOWED_TAGS اینجا با `clinicpro-crawler/content/composer.py` (ثابت + // ALLOWED_TAGS) آینه است: مولد محتوا فقط همین تگ‌ها را تولید می‌کند. اگر این + // فهرست را تغییر دادی، آن‌جا را هم تغییر بده — وگرنه محتوای تولیدشده بی‌صدا + // از صفحه حذف می‌شود. توجه: class و style در ALLOWED_ATTR نیستند. return DOMPurify.sanitize(html, { ALLOWED_TAGS: [ "p", "br", "strong", "em", "b", "i", "u", "ul", "ol", "li", "a",