[WEB-5196] chore: switch from isomorphic-dompurify to dompurify (#7983)

* [WEB-5196] chore: switch from isomorphic-dompurify to dompurify

Replace isomorphic-dompurify with dompurify package in utils.
This change simplifies the dependency and uses the canonical
DOMPurify package directly.

* fix: removing dompurify from the space app as dependency

* chore: remove unused import

---------

Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
Aaron
2025-10-23 04:03:32 -07:00
committed by GitHub
parent 80bd1b6dcd
commit e710f5b278
6 changed files with 100 additions and 621 deletions
-9
View File
@@ -1,5 +1,3 @@
import DOMPurify from "dompurify";
export const addSpaceIfCamelCase = (str: string) => str.replace(/([a-z])([A-Z])/g, "$1 $2");
const fallbackCopyTextToClipboard = (text: string) => {
@@ -50,13 +48,6 @@ export const checkEmailValidity = (email: string): boolean => {
return isEmailValid;
};
export const isEmptyHtmlString = (htmlString: string, allowedHTMLTags: string[] = []) => {
// Remove HTML tags using regex
const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: allowedHTMLTags });
// Trim the string and check if it's empty
return cleanText.trim() === "";
};
export const replaceUnderscoreIfSnakeCase = (str: string) => str.replace(/_/g, " ");
export const capitalizeFirstLetter = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
-1
View File
@@ -31,7 +31,6 @@
"axios": "catalog:",
"clsx": "^2.0.0",
"date-fns": "^4.1.0",
"dompurify": "^3.0.11",
"dotenv": "^16.3.1",
"lodash-es": "catalog:",
"lowlight": "^2.9.0",
-1
View File
@@ -42,7 +42,6 @@
"dotenv": "^16.0.3",
"emoji-picker-react": "^4.5.16",
"export-to-csv": "^1.4.0",
"isomorphic-dompurify": "^2.12.0",
"lodash-es": "catalog:",
"lucide-react": "catalog:",
"mobx": "catalog:",
+1 -1
View File
@@ -27,7 +27,7 @@
"@plane/types": "workspace:*",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"isomorphic-dompurify": "^2.16.0",
"dompurify": "3.2.7",
"lodash-es": "catalog:",
"lucide-react": "catalog:",
"react": "catalog:",
+1 -1
View File
@@ -1,4 +1,4 @@
import DOMPurify from "isomorphic-dompurify";
import DOMPurify from "dompurify";
import type { Content, JSONContent } from "@plane/types";
/**
+98 -608
View File
File diff suppressed because it is too large Load Diff