1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-06 12:02:45 +03:00

Lexical: Table cell bg and format setting fixes

- Updated table cell background color setting to be stable by
  specifically using the background property over the general styles.
- Updated format shorcuts to be correct header levels as per old editor
  and format menu.
- Updated format changes to properly update UI afterwards.
This commit is contained in:
Dan Brown
2025-07-24 16:51:11 +01:00
parent 5fc19b0edf
commit ae4d1d804a
5 changed files with 20 additions and 11 deletions

View File

@@ -353,10 +353,17 @@ export function $convertTableCellNodeElement(
const hasUnderlineTextDecoration = textDecoration.includes('underline');
if (domNode instanceof HTMLElement) {
tableCellNode.setStyles(extractStyleMapFromElement(domNode));
const styleMap = extractStyleMapFromElement(domNode);
styleMap.delete('background-color');
tableCellNode.setStyles(styleMap);
tableCellNode.setAlignment(extractAlignmentFromElement(domNode));
}
const background = style.backgroundColor || null;
if (background) {
tableCellNode.setBackgroundColor(background);
}
return {
after: (childLexicalNodes) => {
if (childLexicalNodes.length === 0) {