Skip to content

Commit

Permalink
Merge pull request #291 from boostcampwm-2024/Hotfix/#288_스페이스만_있을때_캐…
Browse files Browse the repository at this point in the history
…럿_튀는_문제

Hotfix/#288 다른 블록에서 캐럿 튀는 문제, 배치 처리 다시 추가
  • Loading branch information
github-actions[bot] authored Dec 4, 2024
2 parents db95d3f + 7e8d8bd commit 80d12dd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
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

0 comments on commit 80d12dd

Please sign in to comment.