Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: retain if is emoji

Richard Shiue41b99209f13b
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/parsers/callout_node_parser.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/parsers/callout_node_parser.dart
index 92dbf776bf..45d8be9844 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/parsers/callout_node_parser.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/parsers/callout_node_parser.dart
@@ -1,4 +1,5 @@
import 'package:appflowy/plugins/document/presentation/editor_plugins/plugins.dart';
+import 'package:appflowy/shared/icon_emoji_picker/flowy_icon_emoji_picker.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
class CalloutNodeParser extends NodeParser {
@@ -17,8 +18,15 @@ class CalloutNodeParser extends NodeParser {
.split('\n')
.map((e) => '> $e')
.join('\n');
+ final type = node.attributes[CalloutBlockKeys.iconType];
+ final icon = type == FlowyIconType.emoji.name
+ ? node.attributes[CalloutBlockKeys.icon]
+ : null;
+
+ final content = icon == null ? markdown : "> $icon\n$markdown";
+
return '''
-$markdown
+$content
''';
}