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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix(docs): paste table after table (#3214)
Ran Luo1899d34c00fa
diff --git a/packages/docs-ui/src/services/clipboard/clipboard.service.ts b/packages/docs-ui/src/services/clipboard/clipboard.service.tsindex 944bc4a6d9..f27ec35ddb 100644--- a/packages/docs-ui/src/services/clipboard/clipboard.service.ts+++ b/packages/docs-ui/src/services/clipboard/clipboard.service.ts@@ -251,7 +251,9 @@ export class DocClipboardService extends Disposable implements IDocClipboardServdoc: {...docData,body,- }, segmentId, textRanges,+ },+ segmentId,+ textRanges,});} catch (_e) {this._logService.error('[DocClipboardController]', 'clipboard is empty.');diff --git a/packages/docs-ui/src/services/clipboard/html-to-udm/converter.ts b/packages/docs-ui/src/services/clipboard/html-to-udm/converter.tsindex b2e129c683..9adf7b4471 100644--- a/packages/docs-ui/src/services/clipboard/html-to-udm/converter.ts+++ b/packages/docs-ui/src/services/clipboard/html-to-udm/converter.ts@@ -172,7 +172,7 @@ export class HtmlToUDMService {}}- private _processBeforeTable(node: HTMLElement, doc: Partial<IDocumentData>) {+ private _processBeforeTable(node: HTMLElement, doc: Partial<IDocumentData>): void {const tagName = node.tagName.toUpperCase();const body = doc.body!;@@ -180,6 +180,11 @@ export class HtmlToUDMService {case 'TABLE': {if (body.dataStream[body.dataStream.length - 1] !== '\r') {body.dataStream += '\r';++ if (body.paragraphs == null) {+ body.paragraphs = [];+ }+body.paragraphs?.push({startIndex: body.dataStream.length - 1,});@@ -222,7 +227,7 @@ export class HtmlToUDMService {}}- private _processAfterTable(node: HTMLElement, doc: Partial<IDocumentData>) {+ private _processAfterTable(node: HTMLElement, doc: Partial<IDocumentData>): void {const tagName = node.tagName.toUpperCase();const body = doc.body!;