sanitize-html 1.27.4 → 1.27.5
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/CHANGELOG.md +3 -0
- package/README.md +13 -5
- package/dist/sanitize-html-es2015.js +479 -567
- package/dist/sanitize-html.js +71 -65
- package/dist/sanitize-html.min.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -71,13 +71,21 @@ Install module from console:
|
|
|
71
71
|
npm install sanitize-html
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
Import the module:
|
|
75
75
|
|
|
76
|
-
```
|
|
77
|
-
|
|
76
|
+
```bash
|
|
77
|
+
// In ESM
|
|
78
|
+
import sanitizeHtml from 'sanitize-html';
|
|
79
|
+
|
|
80
|
+
// Or in CJS
|
|
81
|
+
const sanitizeHtml = require('sanitize-html');
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Use it in your JavaScript app:
|
|
78
85
|
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
```js
|
|
87
|
+
const dirty = 'some really tacky HTML';
|
|
88
|
+
const clean = sanitizeHtml(dirty);
|
|
81
89
|
```
|
|
82
90
|
|
|
83
91
|
That will allow our default list of allowed tags and attributes through. It's a nice set, but probably not quite what you want. So:
|