From e664a2b83d3aacbae93a641152ce978bd1ccd2a3 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Wed, 4 Dec 2024 19:06:35 +0900 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=EB=8B=A4=EB=A5=B8=20=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=EC=97=90=EC=84=9C=20=EC=BA=90=EB=9F=BF=20=ED=8A=80?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #288 --- client/src/features/editor/utils/domSyncUtils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/features/editor/utils/domSyncUtils.ts b/client/src/features/editor/utils/domSyncUtils.ts index 524f928..e31bbdf 100644 --- a/client/src/features/editor/utils/domSyncUtils.ts +++ b/client/src/features/editor/utils/domSyncUtils.ts @@ -139,14 +139,13 @@ const setsEqual = (a: Set, b: Set): boolean => { }; const sanitizeText = (text: string): string => { - return text.replace(/
/g, "\u00A0").replace(/[<>&"'\s]/g, (match) => { + return text.replace(/
/g, "\u00A0").replace(/[<>&"']/g, (match) => { const escapeMap: Record = { "<": "<", ">": ">", "&": "&", '"': """, "'": "'", - " ": " ", }; return escapeMap[match] || match; }); From 7e8d8bdd85fe810322a1b1ff3facc583d7661915 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Wed, 4 Dec 2024 19:06:56 +0900 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20batch=20=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #288 --- client/src/stores/useSocketStore.ts | 56 ++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/client/src/stores/useSocketStore.ts b/client/src/stores/useSocketStore.ts index 41ce659..e48e227 100644 --- a/client/src/stores/useSocketStore.ts +++ b/client/src/stores/useSocketStore.ts @@ -242,45 +242,45 @@ export const useSocketStore = create((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) => { @@ -289,10 +289,10 @@ export const useSocketStore = create((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) => {