chore: use rich text convert util (#5085)

This commit is contained in:
ybzky
2025-04-24 20:14:43 +08:00
committed by GitHub
parent 9f9fb51606
commit dc61cd9a9c
2 changed files with 3 additions and 3 deletions
+1
View File
@@ -150,4 +150,5 @@ export { MoveCursorOperation } from './commands/operations/doc-cursor.operation'
export { DocSelectAllCommand } from './commands/commands/doc-select-all.command';
export { type ISetDocZoomRatioOperationParams, SetDocZoomRatioOperation } from './commands/operations/set-doc-zoom-ratio.operation';
export { SetParagraphNamedStyleCommand } from './commands/commands/set-heading.command';
export { convertBodyToHtml } from './services/clipboard/udm-to-html/convertor';
// #endregion
@@ -47,7 +47,6 @@ import type { IUniverSheetsUIConfig } from '../config.schema';
import {
BooleanNumber,
convertBodyToHtml,
DEFAULT_WORKSHEET_COLUMN_WIDTH,
DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY,
DEFAULT_WORKSHEET_ROW_HEIGHT,
@@ -69,7 +68,7 @@ import {
} from '@univerjs/core';
import { MessageType } from '@univerjs/design';
import { DocSelectionRenderService } from '@univerjs/docs-ui';
import { convertBodyToHtml, DocSelectionRenderService } from '@univerjs/docs-ui';
import { IRenderManagerService, withCurrentTypeOfRenderer } from '@univerjs/engine-render';
import {
@@ -245,7 +244,7 @@ export class SheetClipboardController extends RxDisposable {
onCopyCellContent(row: number, col: number): string {
const cell = currentSheet!.getCell(row, col);
if (cell?.p?.body?.paragraphs || cell?.p?.body?.textRuns) {
return convertBodyToHtml(cell.p.body);
return convertBodyToHtml(cell.p);
}
const content = cell ? extractPureTextFromCell(cell) : '';
return content;