diff --git a/client/src/features/editor/components/block/Block.style.ts b/client/src/features/editor/components/block/Block.style.ts index cb9a8b20..8b884a28 100644 --- a/client/src/features/editor/components/block/Block.style.ts +++ b/client/src/features/editor/components/block/Block.style.ts @@ -64,6 +64,8 @@ export const textContainerStyle = cva({ base: { ...baseTextStyle, position: "relative", + overflowWrap: "break-word", + whiteSpace: "pre-wrap", "&:empty::before": { color: "gray.300", pointerEvents: "none", diff --git a/client/src/features/editor/utils/domSyncUtils.ts b/client/src/features/editor/utils/domSyncUtils.ts index 2260af65..53a4a4b9 100644 --- a/client/src/features/editor/utils/domSyncUtils.ts +++ b/client/src/features/editor/utils/domSyncUtils.ts @@ -139,13 +139,7 @@ const setsEqual = (a: Set, b: Set): boolean => { }; const sanitizeText = (text: string): string => { - return text - .replace(/
/g, " ") - .replace(/&/g, "&") - .replace(//g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); + return text.replace(/
/g, "\u00A0"); }; // 배열 비교 헬퍼 함수