mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2026-01-06 04:11:53 +00:00
chore: trim markdown text (#7242)
* chore: trim markdown text * chore: trim before saving
This commit is contained in:
parent
aa8c9bad9f
commit
6bcef33d05
@ -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,
|
||||
|
||||
@ -279,7 +279,13 @@ impl Chat {
|
||||
let content = answer_stream_buffer.lock().await.take_content();
|
||||
let metadata = answer_stream_buffer.lock().await.take_metadata();
|
||||
let answer = cloud_service
|
||||
.create_answer(&workspace_id, &chat_id, &content, question_id, metadata)
|
||||
.create_answer(
|
||||
&workspace_id,
|
||||
&chat_id,
|
||||
content.trim(),
|
||||
question_id,
|
||||
metadata,
|
||||
)
|
||||
.await?;
|
||||
save_and_notify_message(uid, &chat_id, &user_service, answer)?;
|
||||
Ok::<(), FlowyError>(())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user