fix: resolve data loss issue during block type conversion (#726)
* fix: resolve data loss issue during block type conversion * fix: flutter test * test: add more tests
This commit is contained in:
parent
0a84917e71
commit
5e5b908e78
1 changed files with 162 additions and 52 deletions
|
|
@ -10,10 +10,16 @@ Future<void> testFormatCharacterShortcut(
|
|||
void Function(bool result, Node before, Node after, EditorState editorState)
|
||||
test, {
|
||||
String text = 'Welcome to AppFlowy Editor 🔥!',
|
||||
Node? node,
|
||||
}) async {
|
||||
final document = Document.blank().addParagraph(
|
||||
builder: (index) => Delta()..insert('$prefix$text'),
|
||||
);
|
||||
final document = Document.blank();
|
||||
if (node != null) {
|
||||
document.insert([0], [node]);
|
||||
} else {
|
||||
document.addParagraph(
|
||||
builder: (index) => Delta()..insert('$prefix$text'),
|
||||
);
|
||||
}
|
||||
final editorState = EditorState(document: document);
|
||||
|
||||
final selection = Selection.collapsed(
|
||||
|
|
|
|||
Loading…
Reference in a new issue