soccerloway / quill-better-table

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

Table can't use ul/ol #68

Open webhao opened 3 years ago

webhao commented 3 years ago

download download-1

WongYAQi commented 3 years ago
// in table.js
const List = Quill.import('formats/list')
const Block = Quill.import('blots/block')
...
TableCell.allowedChildren = [..., List.requiredContainer, Block]

List.requiredContainer can make you add ul, and Block can preserve the TableCell after cancel ul format

weiQuill commented 3 years ago

@WongYAQi It's not enough for adding ul/ol in table cell. To achieve it, the listItem blot and listContainer blot need to be modified accordingly (like table cell line). Currently there is no support for ul/ol in table cell.

WongYAQi commented 3 years ago

@WongYAQi It's not enough for adding ul/ol in table cell. To achieve it, the listItem blot and listContainer blot need to be modified accordingly (like table cell line). Currently there is no support for ul/ol in table cell.

yes, I found that there was problem when merge two list cell, and checkMerge function would throw error.
So I realized that "add ui in table" would be a long-term job.But this may be helpful when just show the ul element with this little change.

xingw-z commented 3 years ago
// in table.js
const List = Quill.import('formats/list')
const Block = Quill.import('blots/block')
...
TableCell.allowedChildren = [..., List.requiredContainer, Block]

List.requiredContainer can make you add ul, and Block can preserve the TableCell after cancel ul format

I'll do as you say, It's half done, The other half is the problem of setting, Didn't you solve it?

xingw-z commented 3 years ago

The setContents will go wrong