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(core): correct range check in getCustomBlockSlice function (#4970)

ZhangWei638001eefd91
diff --git a/packages/core/src/docs/data-model/text-x/utils.ts b/packages/core/src/docs/data-model/text-x/utils.ts
index a1f50145d5..89a4d9d0dd 100644
--- a/packages/core/src/docs/data-model/text-x/utils.ts
+++ b/packages/core/src/docs/data-model/text-x/utils.ts
@@ -163,7 +163,7 @@ export function getCustomBlockSlice(
for (const block of customBlocks) {
const { startIndex } = block;
- if (startIndex >= startOffset && startIndex <= endOffset) {
+ if (startIndex >= startOffset && startIndex < endOffset) {
newCustomBlocks.push(Tools.deepClone(block));
}
}