mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-09-20 05:57:24 +00:00
fix: retain if is emoji
This commit is contained in:
parent
4e0d9fdb0b
commit
41b99209f1
@ -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
|
||||
|
||||
''';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user