From 2ecd4d7119d3da1a0562a22e2ca09ee354cec0ab Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 3 Aug 2026 10:54:43 +0900 Subject: [PATCH] =?UTF-8?q?260803=5F01=5FENH:=20kri=20editor=EC=97=90?= =?UTF-8?q?=EC=84=9C=20preview=20=EB=85=B8=EB=93=9C=20=EC=BB=A4=EC=8A=A4?= =?UTF-8?q?=ED=85=80=20=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- registry/components/kri-editor/KriEditorWysiwyg.tsx | 6 ++++-- registry/components/kri-editor/types.ts | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c041b54..30c6b95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kri-ui-registry", - "version": "0.9.6", + "version": "0.9.7", "private": true, "description": "KRI internal shadcn UI registry", "scripts": { diff --git a/registry/components/kri-editor/KriEditorWysiwyg.tsx b/registry/components/kri-editor/KriEditorWysiwyg.tsx index a576799..8522a75 100644 --- a/registry/components/kri-editor/KriEditorWysiwyg.tsx +++ b/registry/components/kri-editor/KriEditorWysiwyg.tsx @@ -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 ( diff --git a/registry/components/kri-editor/types.ts b/registry/components/kri-editor/types.ts index fd9f394..e531b21 100644 --- a/registry/components/kri-editor/types.ts +++ b/registry/components/kri-editor/types.ts @@ -72,6 +72,7 @@ export type KriEditorProps = { renderToolbarEnd?: (context: KriEditorToolbarContext) => ReactNode editorExtensions?: Extensions allowedCustomHtml?: KriEditorAllowedHtml + transformPreviewHtml?: (html: string) => string } export type ToolbarState = {