plate
plate copied to clipboard
Should remove deleteFragment from withList
The problem of deleting multi-level lists has been solved by the slate library,PR: https://github.com/ianstormtaylor/slate/pull/3825 It is exactly the same as the solution in my PR: https://github.com/udecode/slate-plugins/pull/694 So, I think that the overriding logic related to list deletion can be completely removed:
- remove overrided deleteFragment function for withList
- remove common/src/transforms/deleteFragment.ts
- remove common/src/transforms/mergeNodes.ts
- remove common/src/queries/hasSingleChild.ts
@zbeyens
Thanks for the update, I'll give a try!
@pubuzhixing8 I don't know if removing getListDeleteFragment will allow us to completely remove deleteFragment and its related logic as it's still in use here and here.
@cmditch I understand your question. Currently core function deleteFragment has no special responsibilities compared to editor.deleteFragment,so these two places can be replaced with editor.deleteFragment first. In fact, these two codes use(here and here) are related to the logic of list deleteBackward, and the logic of list deleteBackward can be further optimized.
Unfortunately, slate-plugins has not yet upgraded slate to 0.63.0
We might be able to revisit this now that plate has bumped the slate dep.
Note also deleteFragmentList is seeing some odd behavior. https://github.com/udecode/plate/issues/1256