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/#288 다른 블록에서 캐럿 튀는 문제, 배치 처리 다시 추가 #291

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions client/src/features/editor/utils/domSyncUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,13 @@ const setsEqual = (a: Set<string>, b: Set<string>): boolean => {
};

const sanitizeText = (text: string): string => {
return text.replace(/<br>/g, "\u00A0").replace(/[<>&"'\s]/g, (match) => {
return text.replace(/<br>/g, "\u00A0").replace(/[<>&"']/g, (match) => {
const escapeMap: Record<string, string> = {
"<": "&lt;",
">": "&gt;",
"&": "&amp;",
'"': "&quot;",
"'": "&#x27;",
" ": "&nbsp;",
};
return escapeMap[match] || match;
});
Expand Down
56 changes: 28 additions & 28 deletions client/src/stores/useSocketStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,45 +242,45 @@ export const useSocketStore = create<SocketStore>((set, get) => ({
},

sendBlockInsertOperation: (operation: RemoteBlockInsertOperation) => {
const { socket } = get();
socket?.emit("insert/block", operation);
// const { sendOperation } = get();
// sendOperation(operation);
// const { socket } = get();
// socket?.emit("insert/block", operation);
const { sendOperation } = get();
sendOperation(operation);
},

sendCharInsertOperation: (operation: RemoteCharInsertOperation) => {
const { socket } = get();
socket?.emit("insert/char", operation);
// const { sendOperation } = get();
// sendOperation(operation);
// const { socket } = get();
// socket?.emit("insert/char", operation);
const { sendOperation } = get();
sendOperation(operation);
},

sendBlockUpdateOperation: (operation: RemoteBlockUpdateOperation) => {
const { socket } = get();
socket?.emit("update/block", operation);
// const { sendOperation } = get();
// sendOperation(operation);
// const { socket } = get();
// socket?.emit("update/block", operation);
const { sendOperation } = get();
sendOperation(operation);
},

sendBlockDeleteOperation: (operation: RemoteBlockDeleteOperation) => {
const { socket } = get();
socket?.emit("delete/block", operation);
// const { sendOperation } = get();
// sendOperation(operation);
// const { socket } = get();
// socket?.emit("delete/block", operation);
const { sendOperation } = get();
sendOperation(operation);
},

sendCharDeleteOperation: (operation: RemoteCharDeleteOperation) => {
const { socket } = get();
socket?.emit("delete/char", operation);
// const { sendOperation } = get();
// sendOperation(operation);
// const { socket } = get();
// socket?.emit("delete/char", operation);
const { sendOperation } = get();
sendOperation(operation);
},

sendCharUpdateOperation: (operation: RemoteCharUpdateOperation) => {
const { socket } = get();
socket?.emit("update/char", operation);
// const { sendOperation } = get();
// sendOperation(operation);
// const { socket } = get();
// socket?.emit("update/char", operation);
const { sendOperation } = get();
sendOperation(operation);
},

sendCursorPosition: (position: CursorPosition) => {
Expand All @@ -289,10 +289,10 @@ export const useSocketStore = create<SocketStore>((set, get) => ({
},

sendBlockReorderOperation: (operation: RemoteBlockReorderOperation) => {
const { socket } = get();
socket?.emit("reorder/block", operation);
// const { sendOperation } = get();
// sendOperation(operation);
// const { socket } = get();
// socket?.emit("reorder/block", operation);
const { sendOperation } = get();
sendOperation(operation);
},

sendBlockCheckboxOperation: (operation: RemoteBlockCheckboxOperation) => {
Expand Down
Loading