mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-12 11:48:50 +01:00
11 lines
316 B
TypeScript
11 lines
316 B
TypeScript
export const escapeHtml = (html: string) => {
|
|
return html.replace(/&/g, "&").replace(/</g, "<");
|
|
};
|
|
|
|
export const escapeGreat = (html: string) => {
|
|
return html.replace(/</g, "<");
|
|
};
|
|
|
|
export const escapeAttr = (html: string) => {
|
|
return html.replace(/"/g, """).replace(/'/g, "'");
|
|
};
|