i m 试图在将它输入数据库之前使html窒息性,即使用先质-htmlnpm包,但它没有工作
if (noteContent) {
const resultContent = sanitize(noteContent);
console.log(resultContent);
} else {
setErrorMessages((prevState) => ["note content cannot be empty"]);
}
here when i m entering <img src=? onerror="alert( hello )" />
it returns:
<p><img src=? onerror="alert( hello )" /></p>
难道看不错什么?