soccerloway / quill-better-table

Module for better table in Quill, more useful features are supported.
MIT License
313 stars 120 forks source link

Could you document what the Delta format looks like? #6

Closed npcole closed 5 years ago

npcole commented 5 years ago

What do Delta's look like for these tables? How does it differ from the 'official' Quilljs Delta format 2.0 for tables?

soccerloway commented 5 years ago

image Hi, @npcole quill-better-table has some conflict with the official table module, so you need to disabled the official table module in editor initialize.

soccerloway commented 5 years ago

About the Delta format, image

soccerloway commented 5 years ago

image quill-delta structure is flat, the data structure between red lines correspond to a col html tag, every col will be wrapped with a colgroup tag. colgroup tags will be merged in blot's optimize phase. Since the checkMerge api of TableColGroup always return true, the colgroup tags will be mreged into only one colgroup tag.

soccerloway commented 5 years ago

image In the delta of table, { insert: '\n' } means that it is a block blot. { insert: '\n', attributes: { table-cell-line: { object } } } means that the bock blot is a instance of TableCellLine blot, and the object is attributes of TableCellLine.

soccerloway commented 5 years ago

@npcole I am not sure if it will help you ?

soccerloway commented 5 years ago

I will close this issue~