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
- 平均合并
- 3 天 11 小时
- 30 天内合并 PR
- 44
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TypeCellOS/BlockNote 的其他 Issue
-
Markdown export breaks bold, italic and strikethrough when the styled text starts with a space可能已有人在做 @RaphaelFakhri 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
TypeCellOS/BlockNote#3232 ·
维护者通常 1 天内回复
-
难度 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可能已有人在做 @matthewlipski 于 1 天前认领。 未关闭a11y
难度 2/5 1-3 小时 新手友好度 72/100
TypeCellOS/BlockNote#2824 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 TypeCellOS/BlockNote 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
db-ux-design-system/core-web#8613 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug:new
难度 1/5 1 小时以内 新手友好度 78/100
callstackincubator/simlock#934 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
gchq/LD-Explorer#286 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复