isomorphic-dompurify 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -41,22 +41,24 @@ Please note that DOMPurify library [doesn't follow Semantic Versioning](https://
|
|
|
41
41
|
|
|
42
42
|
Import:
|
|
43
43
|
```javascript
|
|
44
|
-
import
|
|
44
|
+
import DOMPurify from "isomorphic-dompurify";
|
|
45
45
|
```
|
|
46
|
+
_Importing the entire module for the client/browser version is recommended._
|
|
46
47
|
|
|
47
48
|
Sanitize:
|
|
48
49
|
```javascript
|
|
49
|
-
const clean = sanitize(dirtyString);
|
|
50
|
+
const clean = DOMPurify.sanitize(dirtyString);
|
|
50
51
|
```
|
|
51
52
|
or with [config](https://github.com/cure53/DOMPurify/blob/main/README.md):
|
|
52
53
|
```javascript
|
|
53
|
-
const clean = sanitize(dirtyString, { USE_PROFILES: { html: true } });
|
|
54
|
+
const clean = DOMPurify.sanitize(dirtyString, { USE_PROFILES: { html: true } });
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
## Known Issues
|
|
57
58
|
|
|
58
|
-
1.
|
|
59
|
-
2. [
|
|
59
|
+
1. Next.js and Remix are mistakenly trying to use the `browser` entry point on server, which causes the `Window is not defined` issue. [#228](https://github.com/kkomelin/isomorphic-dompurify/issues/228) [#214](https://github.com/kkomelin/isomorphic-dompurify/issues/214) https://github.com/vercel/next.js/discussions/58142
|
|
60
|
+
2. [Can't resolve 'canvas' on Next.js serverless app](https://github.com/kkomelin/isomorphic-dompurify/issues/54)
|
|
61
|
+
3. [Starting from 0.16.0, there is a dependency conflict which causes `ReferenceError: TextEncoder is not defined`](https://github.com/kkomelin/isomorphic-dompurify/issues/91)
|
|
60
62
|
|
|
61
63
|
## License
|
|
62
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isomorphic-dompurify",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Makes it possible to use DOMPurify on server and client in the same way.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"security",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"main": "index.js",
|
|
32
32
|
"types": "index.d.ts",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@types/dompurify": "^3.0.
|
|
35
|
-
"dompurify": "^3.0.
|
|
36
|
-
"jsdom": "^23.
|
|
34
|
+
"@types/dompurify": "^3.0.5",
|
|
35
|
+
"dompurify": "^3.0.8",
|
|
36
|
+
"jsdom": "^23.1.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"jest": "^29.7.0",
|