Repository navigation
fix(quote-block): Shift+Enter inserts a newline plus the "> " prefix - #4299
Merged
Merged
Conversation
A quote block stores its "> " prefix on every line, but Shift+Enter inserted a bare newline, leaving the new line without the prefix. The key handler now cancels the default, inserts "\n> " (replacing any selection, never splitting an existing prefix), puts the caret after the new prefix and notifies the controller through an input event. Removes the cursor-adjustment state that assumed another component would add the prefix. Refs #4286 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…IME and handled events The prefix regex matched across a newline for a bare '>' line, moving the caret into the next line. Use /^> ?/. Also ignore Shift+Enter while composing or when already default-prevented. Refs #4286 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4286-quote-shift-enter
branch
from
November 18, 2026 08:29
9dc9925 to
fa333f2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #4286
Per the ruling on #4286 (decision: a quote block stores its
>prefix on every line), Shift+Enter in a quote block now inserts\n>with the caret after the prefix, matching how Enter inherits the prefix. It used to insert a bare newline.quote-block-node.svelte: Shift+Enter cancels the browser default, inserts via the newinsertQuoteLineBreak, sets the caret, and fires aninputevent so the controller picks up the change. Removed the pending-cursor-adjustment state and the comments describing the bare newline.types/quote-block-node.ts: pureinsertQuoteLineBreak(value, start, end); replaces a selection, and a caret inside an existing>/>prefix is moved past it so the prefix is never split.Tests: new
quote-block-shift-enter.test.ts(component-level with a textarea BaseNode fixture, plus helper edge cases: single line, mid-line, empty>, selection, caret in prefix, unprefixed line, empty content, plain Enter ignored). Each was mutation-checked.test:changedpasses.🤖 Generated with Claude Code