diff --git a/src/editor/utils/clipboard.ts b/src/editor/utils/clipboard.ts index 6316a55..991e3fa 100644 --- a/src/editor/utils/clipboard.ts +++ b/src/editor/utils/clipboard.ts @@ -89,6 +89,9 @@ export function writeElementList(elementList: IElement[], options: DeepRequired< tdDom.rowSpan = td.rowspan const childDom = buildDomFromElementList(zipElementList(td.value!)) tdDom.innerHTML = childDom.innerHTML + if (td.backgroundColor) { + tdDom.style.backgroundColor = td.backgroundColor + } trDom.append(tdDom) } tableDom.append(trDom) @@ -341,6 +344,9 @@ export function getElementListByHTML(htmlText: string, options: IGetElementListB rowspan: tableCell.rowSpan, value: valueList } + if (tableCell.style.backgroundColor) { + td.backgroundColor = tableCell.style.backgroundColor + } tr.tdList.push(td) }) if (tr.tdList.length) {