docs: correct empty whiteList typing in examples

This commit is contained in:
aprilandjan
2021-02-26 19:22:01 +08:00
parent be1d80c89d
commit 3860fe7cca
3 changed files with 3 additions and 3 deletions

View File

@@ -442,7 +442,7 @@ img1, img2, img3, img4
```javascript
var source = "<strong>hello</strong><script>alert(/xss/);</script>end";
var html = xss(source, {
whiteList: [], // 白名单为空,表示过滤所有标签
whiteList: {}, // 白名单为空,表示过滤所有标签
stripIgnoreTag: true, // 过滤所有非白名单标签的HTML
stripIgnoreTagBody: ["script"] // script标签较特殊需要过滤标签中间的内容
});