test: markdown decoder test

This commit is contained in:
Lucas.Xu 2022-11-08 21:34:27 +08:00
parent 4622a412b7
commit 888c1b86f0
2 changed files with 8 additions and 2 deletions

View File

@ -20,6 +20,9 @@ class TextNodeParser extends NodeParser {
if (attributes.isNotEmpty &&
attributes.containsKey(BuiltInAttributeKey.subtype)) {
final subtype = attributes[BuiltInAttributeKey.subtype];
if (node.next == null) {
suffix = '';
}
if (subtype == 'heading') {
final heading = attributes[BuiltInAttributeKey.heading];
if (heading == 'h1') {
@ -51,6 +54,10 @@ class TextNodeParser extends NodeParser {
result = '- [ ] $markdown';
}
}
} else {
if (node.next == null) {
suffix = '';
}
}
return '$result$suffix';
}

View File

@ -130,8 +130,7 @@ You can also use ***AppFlowy Editor*** as a component to build your own app.
* Use / to insert blocks
* Select text to trigger to the toolbar to format your notes.
If you have questions or feedback, please submit an issue on Github or join the community along with 1000+ builders!
''');
If you have questions or feedback, please submit an issue on Github or join the community along with 1000+ builders!''');
});
});
}