Slash menu shows Ctrl+Alt+C (Mod-Alt-c) for "Code Block", but the shortcut is not registered
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- developer-experience, frontend
Hướng nghiên cứu
Bắt đầu với packages/core/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts và so sánh huy hiệu phím tắt của Code Block với trình xử lý Quote trong packages/core/src/blocks/Quote/block.ts. Sau đó, kiểm tra CodeKeyboardShortcutsExtension của khối mã và các bài kiểm thử hiện có để tìm đăng ký phím tắt liên quan và phạm vi kiểm thử. Công việc được xem là hoàn tất khi Ctrl+Alt+C chuyển nội dung nội tuyến thành khối mã hoặc menu slash không còn hiển thị phím tắt đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What's broken?
The "Code Block" item of the default slash menu displays the Mod-Alt-c keyboard shortcut (Ctrl+Alt+C, or ⌘+Alt+C on macOS) as its badge, but pressing it does nothing: no block spec registers this shortcut.
The badge is set in getDefaultSlashMenuItems.ts. The other badges in the same menu have a matching handler, e.g. Mod-Alt-q in Quote/block.ts, Mod-Alt-0 in the paragraph block and Mod-Alt-<level> in the heading block. The code block's CodeKeyboardShortcutsExtension only handles Delete, Tab, Enter and Shift-Enter, plus the ``` input rule.
What did you expect to happen?
Pressing Ctrl+Alt+C (⌘+Alt+C on macOS) in a block with inline content turns it into a code block, like Ctrl+Alt+Q turns it into a quote. Alternatively, if the shortcut is not meant to exist, the slash menu should not display it.
Steps to reproduce
- Open the minimal example: https://www.blocknotejs.org/examples/basic/minimal
- Type
/codeand notice the "CTRL-ALT-C" shortcut displayed next to "Code Block". - Press Escape, type some text in the paragraph and press Ctrl+Alt+C (⌘+Alt+C on macOS).
- The paragraph is not turned into a code block. Ctrl+Alt+Q, by comparison, does turn it into a quote.
BlockNote version
0.55.0 and 0.56.0 (still the case on main at 8e0485c)
Environment
Chromium on Linux, React 19 (not environment specific: the handler is missing from the code)
Additional context
We work around it in XWiki by adding a Mod-Alt-c keyboard shortcut extension to the code block spec, modelled on the quote block's shortcut.
- Ngôn ngữ chính
- TypeScript
- Star
- 10.3k
- Fork
- 780
- Merge trung bình
- 3 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 44
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TypeCellOS/BlockNote
-
Markdown export breaks bold, italic and strikethrough when the styled text starts with a spaceCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
TypeCellOS/BlockNote#3232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TypeCellOS/BlockNote#2949 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
a11y
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
TypeCellOS/BlockNote#2855 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
a11y
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
TypeCellOS/BlockNote#2829 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Comment thread actions: hover-only controls and unlabeled buttons in ThreadsSidebaCó thể đã có người làm @matthewlipski đã nhận hôm nay. Đang mởa11y
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
TypeCellOS/BlockNote#2824 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TypeCellOS/BlockNote
Issue tương tự
-
bug skills
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
equinor/fusion-framework#5846 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Eyevinn/open-videocore#1256 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Frontend build fails with Frappe version-16: DataImport is no longer exported by @framework/uiĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Theme preset geist points at undefined --font-geistCó thể đã có người làm @claude đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày