From 5243e2963ca64d6ff3fe167a4f09fdca69ab7c4c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Nov 2025 02:37:08 +0000 Subject: [PATCH] fix(web): markdown list auto-completion creates new line correctly Fix issue where pressing Enter on a markdown list item would append the list symbol to the current line instead of creating a new line. The fix adds event.preventDefault() to stop the default Enter behavior and prepends a newline character to the inserted list continuation text. Fixes #5236 --- 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); } }