Skip to content

feat: add Unicode quotation mark input rule for quote blocks#2673

Merged
nperez0111 merged 1 commit intomainfrom
fix/quote-block-unicode-input-rule
Apr 24, 2026
Merged

feat: add Unicode quotation mark input rule for quote blocks#2673
nperez0111 merged 1 commit intomainfrom
fix/quote-block-unicode-input-rule

Conversation

@YousefED
Copy link
Copy Markdown
Collaborator

@YousefED YousefED commented Apr 23, 2026

Summary

Add an input rule that converts Unicode quotation mark characters (e.g. ", ", «, », ) followed by a space into a quote block, complementing the existing > shortcut.

Ref: suitenumerique/docs#1955 (comment)

Rationale

Many keyboard layouts (especially non-US ones) produce Unicode quotation marks by default rather than the ASCII > character. Users intuitively type a quotation mark followed by a space to start a quote, and this change makes that work by matching any character in the Unicode Quotation_Mark category via \p{Quotation_Mark}.

Changes

  • Added a new input rule in packages/core/src/blocks/Quote/block.ts using the regex ^\p{Quotation_Mark}\s$ (with the u flag) to trigger quote block conversion.

Impact

No impact on existing functionality — the existing > input rule is unchanged. This is purely additive.

Testing

  • Manual testing with various Unicode quotation characters.

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

The \p{Quotation_Mark} Unicode property covers all quotation mark characters defined by Unicode, including but not limited to: ", ", ", ', ', «, », , , , .

Summary by CodeRabbit

Release Notes

  • New Features
    • Added keyboard shortcut support for creating quote blocks using Unicode quotation marks. Users can now type a quotation mark followed by a space to create a quote block, providing an alternative to the existing > shortcut.

Add an input rule that triggers quote block conversion when typing a
Unicode quotation mark followed by a space, in addition to the existing
`> ` shortcut. This covers characters like ", ", «, », etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blocknote Ready Ready Preview Apr 23, 2026 10:12am
blocknote-website Ready Ready Preview Apr 23, 2026 10:12am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

The Quote block's input rules configuration gains an additional pattern-matching rule. The new rule detects when users type a Unicode quotation mark character at the start of input followed by a space, automatically converting it to a quote block—mirroring the existing > shortcut behavior.

Changes

Cohort / File(s) Summary
Quote Block Input Rules
packages/core/src/blocks/Quote/block.ts
Added input rule pattern to detect Unicode quotation marks (") at the start followed by a space, transforming the input into a quote block with empty props.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A quote mark whispers soft and true,
Press space and see what magic grew—
A block appears, both quick and neat,
Making markdown input sweet!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a Unicode quotation mark input rule for quote blocks, which directly matches the primary alteration in the changeset.
Description check ✅ Passed The description covers all major required sections (Summary, Rationale, Changes, Impact, Testing, Checklist) with sufficient detail, though unit tests were not added and documentation was not updated as noted in the unchecked items.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/quote-block-unicode-input-rule

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/core/src/blocks/Quote/block.ts (1)

87-95: Add a regression test for the Unicode quote input rule.

The implementation matches the existing input-rule pattern, but this new Unicode shortcut should have at least one focused test covering a representative character like « or to prevent future regressions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/core/src/blocks/Quote/block.ts` around lines 87 - 95, Add a focused
regression test that exercises the Unicode quote input rule in the Quote block:
write a unit test that simulates typing a representative Unicode quote character
plus a space (e.g. "« " and/or "“ ") and asserts the input-rule (the object with
find: new RegExp(`^\\p{Quotation_Mark}\\s$`, "u") in the Quote block) produces a
node of type "quote" with the expected props; place the test alongside the other
block input-rule tests, use the same editor/test helpers (applyInputRule or the
project’s test editor harness), and include an explicit assertion so future
changes to the regex or rule behavior will fail the test if broken.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/core/src/blocks/Quote/block.ts`:
- Around line 87-95: Add a focused regression test that exercises the Unicode
quote input rule in the Quote block: write a unit test that simulates typing a
representative Unicode quote character plus a space (e.g. "« " and/or "“ ") and
asserts the input-rule (the object with find: new
RegExp(`^\\p{Quotation_Mark}\\s$`, "u") in the Quote block) produces a node of
type "quote" with the expected props; place the test alongside the other block
input-rule tests, use the same editor/test helpers (applyInputRule or the
project’s test editor harness), and include an explicit assertion so future
changes to the regex or rule behavior will fail the test if broken.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 615e8ca0-9a3b-4622-9fbf-9286fc248808

📥 Commits

Reviewing files that changed from the base of the PR and between 73c785e and 1c6e386.

📒 Files selected for processing (1)
  • packages/core/src/blocks/Quote/block.ts

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@2673

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@2673

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@2673

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@2673

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@2673

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@2673

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@2673

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@2673

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@2673

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@2673

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@2673

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@2673

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@2673

commit: 1c6e386

@nperez0111 nperez0111 merged commit d08531b into main Apr 24, 2026
23 checks passed
@nperez0111 nperez0111 deleted the fix/quote-block-unicode-input-rule branch April 24, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants