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): need to serialize text ranges (#1487)

Ran Luode87e109077f
diff --git a/packages/docs/src/commands/commands/inline-format.command.ts b/packages/docs/src/commands/commands/inline-format.command.ts
index 3eec1b4fb2..baa55cf9d4 100644
--- a/packages/docs/src/commands/commands/inline-format.command.ts
+++ b/packages/docs/src/commands/commands/inline-format.command.ts
@@ -29,7 +29,7 @@ import {
} from '@univerjs/core';
import type { TextRange } from '@univerjs/engine-render';
-import { TextSelectionManagerService } from '../../services/text-selection-manager.service';
+import { serializeTextRange, TextSelectionManagerService } from '../../services/text-selection-manager.service';
import type { IRichTextEditingMutationParams } from '../mutations/core-editing.mutation';
import { RichTextEditingMutation } from '../mutations/core-editing.mutation';
@@ -171,7 +171,7 @@ export const SetInlineFormatCommand: ICommand<ISetInlineFormatCommandParams> = {
params: {
unitId,
actions: [],
- textRanges: selections,
+ textRanges: selections.map(serializeTextRange),
},
};