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 CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Changelog
2
2
 
3
+ 1.27.5 (2020-09-23):
4
+ - Updates README to include ES modules syntax.
5
+
3
6
  1.27.4 (2020-08-26):
4
7
  - Fixes an IE11 regression from using `Array.prototype.includes`, replacing it with `Array.prototype.indexOf`.
5
8
 
package/README.md CHANGED
@@ -71,13 +71,21 @@ Install module from console:
71
71
  npm install sanitize-html
72
72
  ```
73
73
 
74
- Use it in your node app:
74
+ Import the module:
75
75
 
76
- ```js
77
- var sanitizeHtml = require('sanitize-html');
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
- var dirty = 'some really tacky HTML';
80
- var clean = sanitizeHtml(dirty);
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: