Skip to content

Commit e710f5b

Browse files
[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 <[email protected]>
1 parent 80bd1b6 commit e710f5b

File tree

6 files changed

+100
-621
lines changed

6 files changed

+100
-621
lines changed

apps/space/helpers/string.helper.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import DOMPurify from "dompurify";
2-
31
export const addSpaceIfCamelCase = (str: string) => str.replace(/([a-z])([A-Z])/g, "$1 $2");
42

53
const fallbackCopyTextToClipboard = (text: string) => {
@@ -50,13 +48,6 @@ export const checkEmailValidity = (email: string): boolean => {
5048
return isEmailValid;
5149
};
5250

53-
export const isEmptyHtmlString = (htmlString: string, allowedHTMLTags: string[] = []) => {
54-
// Remove HTML tags using regex
55-
const cleanText = DOMPurify.sanitize(htmlString, { ALLOWED_TAGS: allowedHTMLTags });
56-
// Trim the string and check if it's empty
57-
return cleanText.trim() === "";
58-
};
59-
6051
export const replaceUnderscoreIfSnakeCase = (str: string) => str.replace(/_/g, " ");
6152

6253
export const capitalizeFirstLetter = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);

apps/space/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"axios": "catalog:",
3232
"clsx": "^2.0.0",
3333
"date-fns": "^4.1.0",
34-
"dompurify": "^3.0.11",
3534
"dotenv": "^16.3.1",
3635
"lodash-es": "catalog:",
3736
"lowlight": "^2.9.0",

apps/web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"dotenv": "^16.0.3",
4343
"emoji-picker-react": "^4.5.16",
4444
"export-to-csv": "^1.4.0",
45-
"isomorphic-dompurify": "^2.12.0",
4645
"lodash-es": "catalog:",
4746
"lucide-react": "catalog:",
4847
"mobx": "catalog:",

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@plane/types": "workspace:*",
2828
"clsx": "^2.1.1",
2929
"date-fns": "^4.1.0",
30-
"isomorphic-dompurify": "^2.16.0",
30+
"dompurify": "3.2.7",
3131
"lodash-es": "catalog:",
3232
"lucide-react": "catalog:",
3333
"react": "catalog:",

packages/utils/src/string.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import DOMPurify from "isomorphic-dompurify";
1+
import DOMPurify from "dompurify";
22
import type { Content, JSONContent } from "@plane/types";
33

44
/**

0 commit comments

Comments
 (0)