260722_01_ENH: KriEditorWysiwyg 버그 수정

This commit is contained in:
2026-07-22 16:47:07 +09:00
parent a9a86050f2
commit b3d0549f7f
2 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "kri-ui-registry",
"version": "0.9.0",
"version": "0.9.1",
"private": true,
"description": "KRI internal shadcn UI registry",
"scripts": {

View File

@@ -483,10 +483,11 @@ export function KriEditorWysiwyg(props: KriEditorProps) {
if (value == null) return;
const current = editor.getHTML();
const normalizedValue = value || "<p></p>";
if (value !== current && value !== optimisticHtmlRef.current) {
if (normalizedValue !== current && normalizedValue !== optimisticHtmlRef.current) {
// 이미지가 포함된 HTML 업데이트면, 아예 editor를 새로 생성
editor.commands.setContent(value, {
editor.commands.setContent(normalizedValue, {
emitUpdate: false,
parseOptions: {preserveWhitespace: "full"},
});