Slash menu shows Ctrl+Alt+C (Mod-Alt-c) for "Code Block", but the shortcut is not registered
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 88/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- react, typescript
研究方向
從 packages/core/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts 開始,比較 Code Block 的快捷鍵徽章與 packages/core/src/blocks/Quote/block.ts 中的 Quote 處理常式。接著檢查程式碼區塊的 CodeKeyboardShortcutsExtension 和現有測試,以找出相關的快捷鍵註冊與測試涵蓋範圍。完成的標準是 Ctrl+Alt+C 能將行內內容轉換成程式碼區塊,或斜線選單不再顯示該快捷鍵。
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 10.3k
- 分支
- 780
- 平均合併
- 2 天 20 小時
- 30 天內合併 PR
- 43
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TypeCellOS/BlockNote 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
TypeCellOS/BlockNote#2949 · 1 則留言 ·
維護者通常 1 天內回覆
-
a11y
難度 2/5 1-3 小時 新手友好度 68/100
TypeCellOS/BlockNote#2855 ·
維護者通常 1 天內回覆
-
a11y
難度 2/5 1-3 小時 新手友好度 62/100
TypeCellOS/BlockNote#2829 · 1 則留言 ·
維護者通常 1 天內回覆
-
Comment thread actions: hover-only controls and unlabeled buttons in ThreadsSideba可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉a11y
難度 2/5 1-3 小時 新手友好度 72/100
TypeCellOS/BlockNote#2824 ·
維護者通常 1 天內回覆
-
ArrowUp from an empty check list item jumps to the block above the list instead of the previous item未關閉
難度 3/5 1-2 天 新手友好度 68/100
TypeCellOS/BlockNote#3224 ·
維護者通常 1 天內回覆
查看 TypeCellOS/BlockNote 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
phivk/rubiks-lab#33 ·
維護者通常 1 天內回覆
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be edited可能已有人在做 @ManyaJain111 今天認領。 未關閉bug enhancement possible-duplicate
難度 2/5 1-3 小時 新手友好度 77/100
AOSSIE-Org/PictoPy#1637 · 4 則留言 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
chaitin/MonkeyCode#1437 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
area:cards enhancement migration ready-for-agent
難度 2/5 1-3 小時 新手友好度 70/100
fil-donadoni/tolaria#6309 ·
維護者通常 1 天內回覆