Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(doc): doc skeleton index error (#392)

Univer82772c11102a
diff --git a/packages/base-render/src/Component/Docs/Common/Tools.ts b/packages/base-render/src/Component/Docs/Common/Tools.ts
index 49c41622c5..ce6cb07b75 100644
--- a/packages/base-render/src/Component/Docs/Common/Tools.ts
+++ b/packages/base-render/src/Component/Docs/Common/Tools.ts
@@ -319,10 +319,6 @@ export function updateBlockIndex(pages: IDocumentSkeletonPage[], start: number =
const divide = divides[i];
const { spanGroup } = divide;
- // if (spanGroup.length === 0) {
- // continue;
- // }
-
const divStartIndex = preDivideStartIndex;
let divEndIndex = divStartIndex;
for (const span of spanGroup) {
@@ -355,6 +351,10 @@ export function updateBlockIndex(pages: IDocumentSkeletonPage[], start: number =
actualWidth += divide.left;
}
+ if (spanGroup.length === 0) {
+ continue;
+ }
+
divide.st = divStartIndex === 0 ? 0 : divStartIndex + 1;
divide.ed = divEndIndex >= divide.st ? divEndIndex : divide.st;
preDivideStartIndex = divide.ed;