rename color attribute

This commit is contained in:
Philipinho
2025-07-14 13:57:29 -07:00
parent 07d5833695
commit 1b4d88f98a
2 changed files with 4 additions and 4 deletions

View File

@ -22,13 +22,13 @@ export const TableCell = TiptapTableCell.extend({
},
backgroundColorName: {
default: null,
parseHTML: (element) => element.getAttribute('data-color-name') || null,
parseHTML: (element) => element.getAttribute('data-background-color-name') || null,
renderHTML: (attributes) => {
if (!attributes.backgroundColorName) {
return {};
}
return {
'data-color-name': attributes.backgroundColorName.toLowerCase(),
'data-background-color-name': attributes.backgroundColorName.toLowerCase(),
};
},
},

View File

@ -22,13 +22,13 @@ export const TableHeader = TiptapTableHeader.extend({
},
backgroundColorName: {
default: null,
parseHTML: (element) => element.getAttribute('data-color-name') || null,
parseHTML: (element) => element.getAttribute('data-background-color-name') || null,
renderHTML: (attributes) => {
if (!attributes.backgroundColorName) {
return {};
}
return {
'data-color-name': attributes.backgroundColorName.toLowerCase(),
'data-background-color-name': attributes.backgroundColorName.toLowerCase(),
};
},
},