leizongmin / js-xss

Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist
http://jsxss.com
Other
5.2k stars 629 forks source link

svg 怎么加到白名单 有子标签 #162

Closed openainext closed 5 years ago

openainext commented 5 years ago
<svg t="1531901051942" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3578" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M695.373 397.703m-91.258 0a91.258 91.258 0 1 0 182.516 0 91.258 91.258 0 1 0-182.516 0Z" fill="#d81e06" p-id="3579"></path><path d="M909.416 657H114.584c-28.132 0-50.938-22.806-50.938-50.938V417.337c0-28.132 22.806-50.938 50.938-50.938h794.833c28.132 0 50.938 22.806 50.938 50.938v188.725c0 28.132-22.806 50.938-50.939 50.938z" fill="#d81e06" p-id="3580"></path><path d="M909.417 682H114.583c-41.872 0-75.938-34.065-75.938-75.938V417.337c0-41.873 34.066-75.938 75.938-75.938h794.833c41.873 0 75.938 34.065 75.938 75.938v188.725c0.001 41.873-34.065 75.938-75.937 75.938zM114.583 391.398c-14.302 0-25.938 11.636-25.938 25.938v188.725c0 14.303 11.636 25.938 25.938 25.938h794.833c14.303 0 25.938-11.636 25.938-25.938V417.337c0-14.303-11.636-25.938-25.938-25.938H114.583z" fill="#d81e06" p-id="3581"></path><path d="M695.373 397.703m-188.679 0a188.679 188.679 0 1 0 377.358 0 188.679 188.679 0 1 0-377.358 0Z" fill="#d81e06" p-id="3582"></path><path d="M695.374 611.382c-117.823 0-213.679-95.855-213.679-213.679 0-57.076 22.227-110.735 62.585-151.095 40.359-40.358 94.019-62.585 151.094-62.585s110.735 22.227 151.094 62.585c40.358 40.359 62.585 94.019 62.585 151.095 0 117.823-95.856 213.679-213.679 213.679z m0-377.359c-90.253 0-163.679 73.427-163.679 163.68s73.426 163.679 163.679 163.679 163.679-73.426 163.679-163.679-73.427-163.68-163.679-163.68z" fill="#d81e06" p-id="3583"></path><path d="M796.965 426c0 50.4-63.6 67.333-114 67.333s-41.683-5.992-41.683-56.392 40.858-91.258 91.258-91.258c50.399 0 64.425 29.917 64.425 80.317z" fill="#d81e06" p-id="3584"></path><path d="M254.65 758.667H136.381c-13.75 0-25-11.25-25-25s11.25-25 25-25H254.65c13.75 0 25 11.25 25 25s-11.25 25-25 25zM887.619 758.667H769.35c-13.75 0-25-11.25-25-25s11.25-25 25-25h118.269c13.75 0 25 11.25 25 25s-11.25 25-25 25z" fill="#d81e06" p-id="3585"></path><path d="M695.374 513.961c-64.105 0-116.258-52.153-116.258-116.258s52.153-116.258 116.258-116.258 116.258 52.153 116.258 116.258-52.153 116.258-116.258 116.258z m0-182.516c-36.535 0-66.258 29.724-66.258 66.258s29.723 66.258 66.258 66.258 66.258-29.724 66.258-66.258-29.724-66.258-66.258-66.258z" fill="#d81e06" p-id="3586"></path><path d="M156.131 467.951m-25 0a25 25 0 1 0 50 0 25 25 0 1 0-50 0Z" fill="#d81e06" p-id="3587"></path><path d="M156.131 555.447m-25 0a25 25 0 1 0 50 0 25 25 0 1 0-50 0Z" fill="#d81e06" p-id="3588"></path></svg>

例如这样的svg 怎么加到白名单

dreamerblue commented 5 years ago

有什么解决方法吗?遇到了同样的问题。