Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix(web): markdown list auto-completion creates new line correctly (#5238)

Johnnybd21338fdbd2
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);
}
}