* feat: support custom markdown parsers * fix: markdown test * feat: add markdown quote parser * chore: use markdown parser * chore: parse unordered list, to_do list and quote * feat: add a markdown editor example * feat: add bulleted list parser * feat: support nested list and img * feat: support code block * feat: support table parser * chore: refacotr code * fix: flutter analyze * chore: add more tests and remove unused files * fix: test
24 lines
619 B
Dart
24 lines
619 B
Dart
import 'package:appflowy_editor/appflowy_editor.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() async {
|
|
group('ordered list decoder', () {
|
|
final parser = DocumentMarkdownDecoder(
|
|
markdownElementParsers: [
|
|
const MarkdownDividerParserV2(),
|
|
],
|
|
);
|
|
|
|
test('convert ---', () {
|
|
final result = parser.convert('---');
|
|
expect(result.root.children[0].toJson(), {
|
|
'type': 'divider',
|
|
});
|
|
});
|
|
|
|
test('the numbered of - <= 2', () {
|
|
expect(parser.convert('--').isEmpty, true);
|
|
expect(parser.convert('-').isEmpty, true);
|
|
});
|
|
});
|
|
}
|