fix(sanitize): update comments for ALLOWED_TAGS to clarify synchronization with composer.py
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user