mirror of
https://github.com/makeplane/plane.git
synced 2026-04-28 03:49:45 -05:00
[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:
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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:",
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
import DOMPurify from "isomorphic-dompurify";
|
||||
import DOMPurify from "dompurify";
|
||||
import type { Content, JSONContent } from "@plane/types";
|
||||
|
||||
/**
|
||||
|
||||
Generated
+98
-608
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user