diff --git a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/message/ai_markdown_text.dart b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/message/ai_markdown_text.dart index 42518c2381f8c..f17880839098c 100644 --- a/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/message/ai_markdown_text.dart +++ b/frontend/appflowy_flutter/lib/plugins/ai_chat/presentation/message/ai_markdown_text.dart @@ -52,7 +52,7 @@ class _AppFlowyEditorMarkdownState extends State<_AppFlowyEditorMarkdown> { void initState() { super.initState(); - editorState = _parseMarkdown(widget.markdown); + editorState = _parseMarkdown(widget.markdown.trim()); scrollController = EditorScrollController( editorState: editorState, shrinkWrap: true, @@ -65,7 +65,7 @@ class _AppFlowyEditorMarkdownState extends State<_AppFlowyEditorMarkdown> { if (oldWidget.markdown != widget.markdown) { editorState.dispose(); - editorState = _parseMarkdown(widget.markdown); + editorState = _parseMarkdown(widget.markdown.trim()); scrollController.dispose(); scrollController = EditorScrollController( editorState: editorState,