[WEB-1256] fix: accept image as a valid comment (#4409)

* fix: accept image as a valid comment

* fix: update space app helper function
This commit is contained in:
Aaryan Khandelwal 2024-05-09 15:52:17 +05:30 committed by GitHub
parent d8ab3e0087
commit 3a66986785
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ export const checkEmailValidity = (email: string): boolean => {
export const isEmptyHtmlString = (htmlString: string) => {
// Remove HTML tags using regex
const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: [] });
const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: ["img"] });
// Trim the string and check if it's empty
return cleanText.trim() === "";
};

View File

@ -230,7 +230,7 @@ export const checkEmailValidity = (email: string): boolean => {
export const isEmptyHtmlString = (htmlString: string) => {
// Remove HTML tags using regex
const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: [] });
const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: ["img"] });
// Trim the string and check if it's empty
return cleanText.trim() === "";
};