Slash menu shows Ctrl+Alt+C (Mod-Alt-c) for "Code Block", but the shortcut is not registered
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
- Bereich
- developer-experience, frontend
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
- 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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 10.3k
- Forks
- 780
- Ø Merge
- 3 T. 11 Std.
- Gemergte PRs (30 T.)
- 44
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TypeCellOS/BlockNote
-
Markdown export breaks bold, italic and strikethrough when the styled text starts with a spaceEvtl. vergeben @RaphaelFakhri hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
TypeCellOS/BlockNote#3232 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
TypeCellOS/BlockNote#2949 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
a11y
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
TypeCellOS/BlockNote#2855 ·
Maintainer antworten meist innerhalb von 1 Tag
-
a11y
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
TypeCellOS/BlockNote#2829 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Comment thread actions: hover-only controls and unlabeled buttons in ThreadsSidebaEvtl. vergeben @matthewlipski hat das vor 1 Tag übernommen. Offena11y
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
TypeCellOS/BlockNote#2824 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in TypeCellOS/BlockNote
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Nimblesite/SharpLsp#468 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Bundled uv is never updated and trusts the compromised eMudhra certificatesEvtl. vergeben @FabienDanieau hat das heute übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
bg_wait's blocking mode (stopOnAttention: false) is under-documented and effectively undiscoverableOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
nicobailon/pi-subagents#3019 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
db-ux-design-system/core-web#8613 ·
Maintainer antworten meist innerhalb von 1 Tag