Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Slash menu shows Ctrl+Alt+C (Mod-Alt-c) for "Code Block", but the shortcut is not registered

Offen Anfängerfreundlich
#3,211 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
88/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
react, typescript

Rechercherichtung

Beginne mit packages/core/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts und vergleiche das Tastenkürzel-Badge des Code Block mit dem Quote-Handler in packages/core/src/blocks/Quote/block.ts. Untersuche dann die CodeKeyboardShortcutsExtension des Code Blocks und die vorhandenen Tests, um die relevante Tastenkürzelregistrierung und Testabdeckung zu finden. Als erledigt gilt die Aufgabe, wenn Ctrl+Alt+C Inline-Inhalt in einen Code Block umwandelt oder das Slash-Menü dieses Tastenkürzel nicht mehr anzeigt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
  1. Open the minimal example: https://www.blocknotejs.org/examples/basic/minimal
  2. Type /code and notice the "CTRL-ALT-C" shortcut displayed next to "Code Block".
  3. Press Escape, type some text in the paragraph and press Ctrl+Alt+C (⌘+Alt+C on macOS).
  4. 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.

Vorherrschende Sprache
TypeScript
Sterne
10.3k
Forks
780
Ø Merge
3 T. 11 Std.
Gemergte PRs (30 T.)
44

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TypeCellOS/BlockNote

Alle Issues in TypeCellOS/BlockNote

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.