mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: checklist auto continuation (#737)
This commit is contained in:
@ -14,7 +14,7 @@ import ResourceIcon from "./ResourceIcon";
|
|||||||
import showResourcesSelectorDialog from "./ResourcesSelectorDialog";
|
import showResourcesSelectorDialog from "./ResourcesSelectorDialog";
|
||||||
import "../less/memo-editor.less";
|
import "../less/memo-editor.less";
|
||||||
|
|
||||||
const listItemSymbolList = ["* ", "- ", "- [ ] ", "- [x] ", "- [X] "];
|
const listItemSymbolList = ["- [ ] ", "- [x] ", "- [X] ", "* ", "- "];
|
||||||
|
|
||||||
const getEditorContentCache = (): string => {
|
const getEditorContentCache = (): string => {
|
||||||
return storage.get(["editorContentCache"]).editorContentCache ?? "";
|
return storage.get(["editorContentCache"]).editorContentCache ?? "";
|
||||||
@ -132,6 +132,7 @@ const MemoEditor = () => {
|
|||||||
if (rowValue.startsWith(listItemSymbol)) {
|
if (rowValue.startsWith(listItemSymbol)) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
editorRef.current.insertText("", `\n${listItemSymbol}`);
|
editorRef.current.insertText("", `\n${listItemSymbol}`);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user