mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-25 14:55:20 +01:00
Fix markdown newline handling during IME composition (#36421)
### Summary Fix incorrect newline handling in markdown editor when using IME input. ### Details While composing text with an IME, pressing Enter should not trigger markdown indentation logic. This change skips indentation handling during composition by checking `e.isComposing`. This prevents unexpected line breaks and formatting issues for CJK users.
This commit is contained in:
parent
111c822a30
commit
58cd8244ba
@ -186,6 +186,7 @@ export function markdownHandleIndention(tvs: TextareaValueSelection): MarkdownHa
|
||||
}
|
||||
|
||||
function handleNewline(textarea: HTMLTextAreaElement, e: KeyboardEvent) {
|
||||
if (e.isComposing) return;
|
||||
const ret = markdownHandleIndention({value: textarea.value, selStart: textarea.selectionStart, selEnd: textarea.selectionEnd});
|
||||
if (!ret.handled || !ret.valueSelection) return; // FIXME: the "handled" seems redundant, only valueSelection is enough (null for unhandled)
|
||||
e.preventDefault();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user