xss 白名单优化 安装 xss 白名单 安装 yarn add xss xss 白名单 下面展示一些 内联代码片。 import xss ,{ escapeAttrValue, whiteList }from 'xss'; export function sanitize(html: string, whiteList): string { return xss(html, { onTagAttr(tag, name, value) { if (tag === 'img'