This commit is contained in:
Vanessa 2023-03-08 22:34:46 +08:00
parent fe6e88ea45
commit bbd1333f93
6 changed files with 16 additions and 12 deletions

View file

@ -2,6 +2,10 @@ export const escapeHtml = (html: string) => {
return html.replace(/&/g, "&amp;").replace(/</g, "&lt;");
};
export const escapeGreat = (html: string) => {
return html.replace(/</g, "&lt;");
};
export const escapeAttr = (html: string) => {
return html.replace(/"/g, "&quot;").replace(/'/g, "&apos;");
};