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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user