mirror of
https://github.com/AppFlowy-IO/AppFlowy
synced 2026-05-23 17:18:31 +00:00
feat: use patch nodes
This commit is contained in:
parent
9ceced4648
commit
40c3f07be4
1 changed files with 7 additions and 3 deletions
|
|
@ -17,10 +17,14 @@ _pasteHTML(EditorState editorState, String html) {
|
|||
return;
|
||||
}
|
||||
|
||||
final tb = TransactionBuilder(editorState);
|
||||
for (final node in nodes) {
|
||||
tb.insertNode(selection.end.path, node);
|
||||
final path = [...selection.end.path];
|
||||
if (path.isEmpty) {
|
||||
return;
|
||||
}
|
||||
path[path.length - 1]++;
|
||||
|
||||
final tb = TransactionBuilder(editorState);
|
||||
tb.insertNodes(path, nodes);
|
||||
tb.commit();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue