diff options
Diffstat (limited to 'web_src/js/features/comp/EditorMarkdown.ts')
-rw-r--r-- | web_src/js/features/comp/EditorMarkdown.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/web_src/js/features/comp/EditorMarkdown.ts b/web_src/js/features/comp/EditorMarkdown.ts index 2af003ccb0..5e2ef121f5 100644 --- a/web_src/js/features/comp/EditorMarkdown.ts +++ b/web_src/js/features/comp/EditorMarkdown.ts @@ -92,6 +92,7 @@ function handleNewline(textarea: HTMLTextAreaElement, e: Event) { if (!line) { // clear current line if we only have i.e. '1. ' and the user presses enter again to finish creating a list textarea.value = value.slice(0, lineStart) + value.slice(lineEnd); + textarea.setSelectionRange(selStart - prefix.length, selStart - prefix.length); } else { // start a new line with the same indention and prefix let newPrefix = prefix; |