mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: use patch nodes
This commit is contained in:
parent
9ceced4648
commit
40c3f07be4
@ -17,10 +17,14 @@ _pasteHTML(EditorState editorState, String html) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final tb = TransactionBuilder(editorState);
|
final path = [...selection.end.path];
|
||||||
for (final node in nodes) {
|
if (path.isEmpty) {
|
||||||
tb.insertNode(selection.end.path, node);
|
return;
|
||||||
}
|
}
|
||||||
|
path[path.length - 1]++;
|
||||||
|
|
||||||
|
final tb = TransactionBuilder(editorState);
|
||||||
|
tb.insertNodes(path, nodes);
|
||||||
tb.commit();
|
tb.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user