mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +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:
@@ -74,8 +74,12 @@ export class EditorTableCreator extends EditorUiElement {
|
||||
return;
|
||||
}
|
||||
|
||||
const targetColWidth = Math.min(Math.round(840 / columns), 240);
|
||||
const colWidths = Array(columns).fill(targetColWidth + 'px');
|
||||
|
||||
this.getContext().editor.update(() => {
|
||||
const table = $createTableNodeWithDimensions(rows, columns, false) as CustomTableNode;
|
||||
table.setColWidths(colWidths);
|
||||
$insertNewBlockNodeAtSelection(table);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user