Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/#222 드래그하고 입력할때 텍스트 안지워지는 문제 해결 #223

Merged
Prev Previous commit
Next Next commit
fix: 특수문자 드래그 해결
  • Loading branch information
Ludovico7 committed Nov 27, 2024
commit ab73de5a9817f782faf410770ec9af349840d661
2 changes: 2 additions & 0 deletions client/src/features/editor/components/block/Block.style.ts
Original file line number Diff line number Diff line change
@@ -64,6 +64,8 @@ export const textContainerStyle = cva({
base: {
...baseTextStyle,
position: "relative",
wordBreak: "break-word",
whiteSpace: "pre-wrap",
"&:empty::before": {
color: "gray.300",
pointerEvents: "none",
8 changes: 1 addition & 7 deletions client/src/features/editor/utils/domSyncUtils.ts
Original file line number Diff line number Diff line change
@@ -139,13 +139,7 @@ const setsEqual = (a: Set<string>, b: Set<string>): boolean => {
};

const sanitizeText = (text: string): string => {
return text
.replace(/<br>/g, "&nbsp;")
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
return text.replace(/<br>/g, "\u00A0");
};

// 배열 비교 헬퍼 함수