diff --git a/apps/server/src/ee b/apps/server/src/ee index ea6b8990..4a454317 160000 --- a/apps/server/src/ee +++ b/apps/server/src/ee @@ -1 +1 @@ -Subproject commit ea6b8990a12a0593eba63bad9d903f39e6fb67a2 +Subproject commit 4a454317bfca47391f1eaf70ce30c67caffd36bd diff --git a/packages/editor-ext/src/lib/table/cell.ts b/packages/editor-ext/src/lib/table/cell.ts index 25a311b9..63df7dcf 100644 --- a/packages/editor-ext/src/lib/table/cell.ts +++ b/packages/editor-ext/src/lib/table/cell.ts @@ -2,33 +2,39 @@ import { TableCell as TiptapTableCell } from "@tiptap/extension-table-cell"; export const TableCell = TiptapTableCell.extend({ name: "tableCell", - content: "(paragraph | heading | bulletList | orderedList | taskList | blockquote | callout | image | video | attachment | mathBlock | details | codeBlock)+", - + content: + "(paragraph | heading | bulletList | orderedList | taskList | blockquote | callout | image | video | attachment | mathBlock | details | codeBlock)+", + addAttributes() { return { ...this.parent?.(), backgroundColor: { default: null, - parseHTML: (element) => element.style.backgroundColor || null, + parseHTML: (element) => + element.style.backgroundColor || + element.getAttribute("data-background-color") || + null, renderHTML: (attributes) => { if (!attributes.backgroundColor) { return {}; } return { style: `background-color: ${attributes.backgroundColor}`, - 'data-background-color': attributes.backgroundColor, + "data-background-color": attributes.backgroundColor, }; }, }, backgroundColorName: { default: null, - parseHTML: (element) => element.getAttribute('data-background-color-name') || null, + parseHTML: (element) => + element.getAttribute("data-background-color-name") || null, renderHTML: (attributes) => { if (!attributes.backgroundColorName) { return {}; } return { - 'data-background-color-name': attributes.backgroundColorName.toLowerCase(), + "data-background-color-name": + attributes.backgroundColorName.toLowerCase(), }; }, }, diff --git a/packages/editor-ext/src/lib/table/header.ts b/packages/editor-ext/src/lib/table/header.ts index 399a8cf0..501f089d 100644 --- a/packages/editor-ext/src/lib/table/header.ts +++ b/packages/editor-ext/src/lib/table/header.ts @@ -2,36 +2,42 @@ import { TableHeader as TiptapTableHeader } from "@tiptap/extension-table-header export const TableHeader = TiptapTableHeader.extend({ name: "tableHeader", - content: "(paragraph | heading | bulletList | orderedList | taskList | blockquote | callout | image | video | attachment | mathBlock | details | codeBlock)+", - + content: + "(paragraph | heading | bulletList | orderedList | taskList | blockquote | callout | image | video | attachment | mathBlock | details | codeBlock)+", + addAttributes() { return { ...this.parent?.(), backgroundColor: { default: null, - parseHTML: (element) => element.style.backgroundColor || null, + parseHTML: (element) => + element.style.backgroundColor || + element.getAttribute("data-background-color") || + null, renderHTML: (attributes) => { if (!attributes.backgroundColor) { return {}; } return { style: `background-color: ${attributes.backgroundColor}`, - 'data-background-color': attributes.backgroundColor, + "data-background-color": attributes.backgroundColor, }; }, }, backgroundColorName: { default: null, - parseHTML: (element) => element.getAttribute('data-background-color-name') || null, + parseHTML: (element) => + element.getAttribute("data-background-color-name") || null, renderHTML: (attributes) => { if (!attributes.backgroundColorName) { return {}; } return { - 'data-background-color-name': attributes.backgroundColorName.toLowerCase(), + "data-background-color-name": + attributes.backgroundColorName.toLowerCase(), }; }, }, }; }, -}); \ No newline at end of file +});