Skip to content

Commit

Permalink
fix: col have same col id should merge (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxming authored Jan 17, 2025
1 parent f2e6b62 commit 602535a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 0 additions & 12 deletions docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,4 @@ quill2.setContents([
{ insert: '25' },
{ attributes: { 'table-up-cell-inner': { tableId: '8v36875pbr6', rowId: 'fow0uajprzw', colId: 'y0epsy6odnm', rowspan: 1, colspan: 1 } }, insert: '\n' },
{ insert: '\n' },

// TODO: balance table loop
// { insert: '\n' },
// { insert: { 'table-up-col': { full: false, width: 583 } } },
// { insert: { 'table-up-col': { full: false, width: 583 } } },
// { attributes: { 'table-up-cell-inner': { rowspan: 1, colspan: 1 } }, insert: '\n' },
// { attributes: { 'table-up-cell-inner': { rowspan: 1, colspan: 1 } }, insert: '\n' },
// { attributes: { 'table-up-cell-inner': { rowspan: 1, colspan: 1 } }, insert: '\n' },
// { insert: 'blockquote' },
// { attributes: { 'blockquote': true, 'table-up-cell-inner': { rowspan: 1, colspan: 1 } }, insert: '\n\n' },
// { attributes: { 'table-up-cell-inner': { rowspan: 1, colspan: 1 } }, insert: '\n' },
// { insert: '\n' },
]);
4 changes: 4 additions & 0 deletions src/formats/table-col-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ export class TableColFormat extends BlockEmbed {
const tableColgroup = findParentBlot(this, blotName.tableColgroup);
tableColgroup.align = this.align;

if (this.next != null && this.checkMerge()) {
this.next.remove();
}

super.optimize(context);
}

Expand Down

0 comments on commit 602535a

Please sign in to comment.