mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
16 lines
500 B
TypeScript
16 lines
500 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, "'");
|
|
};
|
|
|
|
export const escapeAriaLabel = (html: string) => {
|
|
return html.replace(/"/g, """).replace(/'/g, "'")
|
|
.replace(/</g, "&lt;").replace(/</g, "&lt;");
|
|
};
|