diff --git a/src/editor/utils/clipboard.ts b/src/editor/utils/clipboard.ts index 8ddf6bb..1eb64ea 100644 --- a/src/editor/utils/clipboard.ts +++ b/src/editor/utils/clipboard.ts @@ -118,6 +118,9 @@ export function writeElementList(elementList: IElement[], options: DeepRequired< if (element.size) { dom.style.fontSize = `${element.size}px` } + if (element.highlight) { + dom.style.backgroundColor = element.highlight + } clipboardDom.append(dom) } } @@ -156,6 +159,9 @@ export function getElementListByHTML(htmlText: string, options: IGetElementListB if (rowFlex !== RowFlex.LEFT) { element.rowFlex = rowFlex } + if (style.backgroundColor !== 'rgba(0, 0, 0, 0)') { + element.highlight = style.backgroundColor + } elementList.push(element) } } else if (dom.nodeType === 1) {