260803_01_ENH: kri editor에서 preview 노드 커스텀 가능하도록 수정
This commit is contained in:
@@ -89,6 +89,7 @@ export function KriEditorWysiwyg(props: KriEditorProps) {
|
||||
toolbar = {},
|
||||
editorExtensions = [],
|
||||
allowedCustomHtml,
|
||||
transformPreviewHtml,
|
||||
} = props;
|
||||
|
||||
const showHtmlToggle = mode === "both";
|
||||
@@ -561,8 +562,9 @@ export function KriEditorWysiwyg(props: KriEditorProps) {
|
||||
}, [command, editor, props.onCommandReady]);
|
||||
|
||||
const previewHtml = useMemo(() => {
|
||||
return sanitizeHtmlOpt ? sanitizeHtml(previewSource, allowedCustomHtml) : previewSource;
|
||||
}, [allowedCustomHtml, previewSource, sanitizeHtmlOpt]);
|
||||
const sanitized = sanitizeHtmlOpt ? sanitizeHtml(previewSource, allowedCustomHtml) : previewSource;
|
||||
return transformPreviewHtml ? transformPreviewHtml(sanitized) : sanitized;
|
||||
}, [allowedCustomHtml, previewSource, sanitizeHtmlOpt, transformPreviewHtml]);
|
||||
|
||||
if (!editor) {
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user