Skip to content

Commit

Permalink
fix: #1918
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocs committed Aug 6, 2024
1 parent f36da88 commit db490c2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down

0 comments on commit db490c2

Please sign in to comment.