From a379e24fe3764b57e5ee7ae43d91c77b66b16ed4 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:06:03 +0800 Subject: [PATCH] chore: trim markdown text --- .../ai_chat/presentation/message/ai_markdown_text.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,