1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

WYSIWYG: Code & table fixes

- Fixed new code block insertion to remove selection area instead of
  just adding after.
- Added default table column widths to not be collapsed
- Updated table dom export to not duplicate colgroups.
This commit is contained in:
Dan Brown
2024-10-05 12:42:47 +01:00
parent 9b2520aa0c
commit c314a60a16
5 changed files with 40 additions and 30 deletions

View File

@ -1,7 +1,7 @@
import {
$getRoot,
$isDecoratorNode,
$isElementNode,
$isElementNode, $isRootNode,
$isTextNode,
ElementNode,
LexicalEditor,
@ -84,7 +84,7 @@ export function $getNearestBlockNodeForCoords(editor: LexicalEditor, x: number,
export function $getNearestNodeBlockParent(node: LexicalNode): LexicalNode|null {
const isBlockNode = (node: LexicalNode): boolean => {
return ($isElementNode(node) || $isDecoratorNode(node)) && !node.isInline();
return ($isElementNode(node) || $isDecoratorNode(node)) && !node.isInline() && !$isRootNode(node);
};
if (isBlockNode(node)) {