diff --git a/packages/docs-ui/src/services/clipboard/html-to-udm/parse-node-style.ts b/packages/docs-ui/src/services/clipboard/html-to-udm/parse-node-style.ts index 700af378742..a106ef79f6a 100644 --- a/packages/docs-ui/src/services/clipboard/html-to-udm/parse-node-style.ts +++ b/packages/docs-ui/src/services/clipboard/html-to-udm/parse-node-style.ts @@ -122,12 +122,17 @@ export function extractNodeStyle(node: HTMLElement): ITextStyle { } case 'color': { - const color = new ColorKit(cssValue); + try { + const color = new ColorKit(cssValue); - if (color.isValid) { - docStyles.cl = { - rgb: color.toRgbString(), - }; + if (color.isValid) { + docStyles.cl = { + rgb: color.toRgbString(), + }; + } + // eslint-disable-next-line unused-imports/no-unused-vars + } catch (_e) { + // ignore } break; diff --git a/packages/sheets-ui/src/services/clipboard/html-to-usm/parse-node-style.ts b/packages/sheets-ui/src/services/clipboard/html-to-usm/parse-node-style.ts index dc7006f67b0..e667b02710f 100644 --- a/packages/sheets-ui/src/services/clipboard/html-to-usm/parse-node-style.ts +++ b/packages/sheets-ui/src/services/clipboard/html-to-usm/parse-node-style.ts @@ -76,6 +76,7 @@ function parseStyleByProperty(styles: CSSStyleDeclaration | Record