From c1db5011422b43b6bceabb2a27ca10a505a95e91 Mon Sep 17 00:00:00 2001 From: jocs Date: Mon, 5 Aug 2024 16:21:09 +0800 Subject: [PATCH] fix: #1918 --- .../core/src/docs/data-model/text-x/apply-utils/common.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/core/src/docs/data-model/text-x/apply-utils/common.ts b/packages/core/src/docs/data-model/text-x/apply-utils/common.ts index 34c2b1a9cea..b598c170dc9 100644 --- a/packages/core/src/docs/data-model/text-x/apply-utils/common.ts +++ b/packages/core/src/docs/data-model/text-x/apply-utils/common.ts @@ -741,6 +741,7 @@ export function deleteTables(body: IDocumentBody, textLength: number, currentInd for (let i = 0, len = tables.length; i < len; i++) { const table = tables[i]; const { startIndex: st, endIndex: ed } = table; + if (startIndex <= st && endIndex >= ed) { removeTables.push({ ...table, @@ -753,6 +754,11 @@ export function deleteTables(body: IDocumentBody, textLength: number, currentInd table.startIndex = segments[0]; table.endIndex = segments[1]; + + // FIXME: @JOCS, why startIndex will equal to endIndex here? + if (table.startIndex === table.endIndex) { + continue; + } } else if (endIndex < st) { table.startIndex -= textLength; table.endIndex -= textLength;