From bd21338fdbd258423095f153252e9cbd97331287 Mon Sep 17 00:00:00 2001 From: Johnny Date: Sat, 8 Nov 2025 10:47:10 +0800 Subject: [PATCH] fix(web): markdown list auto-completion creates new line correctly (#5238) Co-authored-by: Claude --- web/src/components/MemoEditor/Editor/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/components/MemoEditor/Editor/index.tsx b/web/src/components/MemoEditor/Editor/index.tsx index fbeb98bb7..d64d1881f 100644 --- a/web/src/components/MemoEditor/Editor/index.tsx +++ b/web/src/components/MemoEditor/Editor/index.tsx @@ -164,7 +164,8 @@ const Editor = forwardRef(function Editor(props: Props, ref: React.ForwardedRef< // Detect list item using regex-based detection const listInfo = detectLastListItem(prevContent); if (listInfo.type) { - const insertText = generateListContinuation(listInfo); + event.preventDefault(); + const insertText = "\n" + generateListContinuation(listInfo); editorActions.insertText(insertText); } }