[codex] Add blockquote continuation - #93
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba4bdad6f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| const line = view.state.doc.lineAt(from); | ||
| const match = line.text.match(/^(\s*>+\s?)(.*)$/); |
There was a problem hiding this comment.
Preserve spaced nested quote markers on Enter
Update the blockquote marker match so it captures the full quote prefix for spaced nesting (for example > > ), not just contiguous > characters. With the current regex, a line like > > nested is parsed as marker > plus content > nested, so pressing Enter inserts only a single-level > on the new line and silently drops one nesting level. This regresses continuation behavior for valid Markdown blockquote syntax commonly found in existing documents.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds Markdown blockquote continuation behavior to the CodeMirror editor so pressing Enter inside a blockquote line continues the quote, and pressing Enter on an empty quote line exits the blockquote.
Changes:
- Introduces
continueBlockquoteCommandto continue or exit blockquotes on Enter. - Wires the command into the base CodeMirror keymap for the
Enterkey. - Adds unit tests covering continuation, exit, and non-blockquote fallthrough behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/controllerShortcuts.test.ts | Adds unit tests for Enter-based blockquote continuation/exit behavior. |
| src/renderer/editor/codemirror/extensions.ts | Registers the new Enter keybinding in the base keymap. |
| src/renderer/editor/codemirror/commands.ts | Implements the continueBlockquoteCommand command logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| const line = view.state.doc.lineAt(from); | ||
| const match = line.text.match(/^(\s*>+\s?)(.*)$/); |
| const line = view.state.doc.lineAt(from); | ||
| const match = line.text.match(/^(\s*>+\s?)(.*)$/); | ||
| if (!match) { | ||
| return false; | ||
| } |
| (): import("@codemirror/view").KeyBinding[] => [ | ||
| { | ||
| key: "Enter", | ||
| run: continueBlockquoteCommand, |
Summary
Validation