siyuan/app/src/util/escape.ts

3 lines
111 B
TypeScript

export const escapeHtml = (html: string) => {
return html.replace(/&/g, "&amp;").replace(/</g, "&lt;");
};