fix(sanitize): update comments for ALLOWED_TAGS to clarify synchronization with composer.py

This commit is contained in:
hamed
2026-07-27 11:35:54 +03:30
parent 2b68ad46b7
commit 2f8dec0fb8
+4
View File
@@ -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",