Skip to content

Commit 888c1b8

Browse files
committed
test: markdown decoder test
1 parent 4622a41 commit 888c1b8

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

frontend/app_flowy/packages/appflowy_editor/lib/src/plugins/markdown/encoder/parser/text_node_parser.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ class TextNodeParser extends NodeParser {
2020
if (attributes.isNotEmpty &&
2121
attributes.containsKey(BuiltInAttributeKey.subtype)) {
2222
final subtype = attributes[BuiltInAttributeKey.subtype];
23+
if (node.next == null) {
24+
suffix = '';
25+
}
2326
if (subtype == 'heading') {
2427
final heading = attributes[BuiltInAttributeKey.heading];
2528
if (heading == 'h1') {
@@ -51,6 +54,10 @@ class TextNodeParser extends NodeParser {
5154
result = '- [ ] $markdown';
5255
}
5356
}
57+
} else {
58+
if (node.next == null) {
59+
suffix = '';
60+
}
5461
}
5562
return '$result$suffix';
5663
}

frontend/app_flowy/packages/appflowy_editor/test/plugins/markdown/encoder/document_markdown_encoder_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ You can also use ***AppFlowy Editor*** as a component to build your own app.
130130
* Use / to insert blocks
131131
* Select text to trigger to the toolbar to format your notes.
132132
133-
If you have questions or feedback, please submit an issue on Github or join the community along with 1000+ builders!
134-
''');
133+
If you have questions or feedback, please submit an issue on Github or join the community along with 1000+ builders!''');
135134
});
136135
});
137136
}

0 commit comments

Comments
 (0)