251212_01_ENH : kri-editor 1차 완성, 프로젝트 정보 저장 api연동 완료

This commit is contained in:
2025-12-12 17:27:12 +09:00
parent 1080880fba
commit d9775c8a1d
46 changed files with 2124 additions and 1668 deletions

View File

@@ -0,0 +1,15 @@
export function sanitizeHtml(input: string): string {
if (!input) return "";
let s = input.replace(/<\s*script[^>]*>[\s\S]*?<\s*\/\s*script\s*>/gi, "");
s = s.replace(/<\s*style[^>]*>[\s\S]*?<\s*\/\s*style\s*>/gi, "");
s = s.replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi, "");
s = s.replace(/\s(href|src)\s*=\s*("|')\s*javascript:[^"']*("|')/gi, ' $1="#"');
return s;
}
// 기존 코드 호환용
export function sanitizeHtmlForPreview(input: string): string {
return sanitizeHtml(input);
}