[bug][editor] Slash command whose name contains a space (e.g. "/Heading 1") inserts literal text instead of the block #124

Closed
opened 2026-06-22 06:27:46 +03:00 by Ghost · 0 comments

Severity: medium

The slash menu lists items with spaces in their labels ("Heading 1", "Math block", "2 Columns"), but typing the label as shown breaks the command.

Where: apps/client/src/features/editor/extensions/slash-command.ts:16 — the tiptap Suggestion uses char: '/' with no allowSpaces, so a space terminates the query and closes the menu.

Repro (live):

  1. In the body editor type /Heading 1 and press Enter → the menu closed on the space; the literal text /Heading 1 stays in the document as a plain paragraph and no heading is created — zero feedback.
  2. Control: /h1 + Enter → correctly creates an <h1> and leaves no literal text.

Impact: a user who types what the menu shows gets dead literal text and a silently non-functional command.

Suggested fix: set allowSpaces: true on the slash suggestion (and keep the existing fuzzy match), or insert the top match on Enter even when the query contains a space.


Filed from an automated full-product QA pass on develop @ v0.93.0-64-gb60190ff, fresh DB. Each item below was reproduced live in a clean browser session unless noted.

Screenshot

Issue 124: typing '/Heading 1' + Enter leaves literal '/Heading 1' text in the body, no heading created

**Severity:** medium The slash menu lists items with spaces in their labels ("Heading 1", "Math block", "2 Columns"), but typing the label as shown breaks the command. **Where:** `apps/client/src/features/editor/extensions/slash-command.ts:16` — the tiptap `Suggestion` uses `char: '/'` with no `allowSpaces`, so a space terminates the query and closes the menu. **Repro (live):** 1. In the body editor type `/Heading 1` and press Enter → the menu closed on the space; the literal text `/Heading 1` stays in the document as a plain paragraph and **no heading is created** — zero feedback. 2. Control: `/h1` + Enter → correctly creates an `<h1>` and leaves no literal text. **Impact:** a user who types what the menu shows gets dead literal text and a silently non-functional command. **Suggested fix:** set `allowSpaces: true` on the slash suggestion (and keep the existing fuzzy match), or insert the top match on Enter even when the query contains a space. --- _Filed from an automated full-product QA pass on `develop` @ `v0.93.0-64-gb60190ff`, fresh DB. Each item below was reproduced live in a clean browser session unless noted._ ### Screenshot ![Issue 124: typing '/Heading 1' + Enter leaves literal '/Heading 1' text in the body, no heading created](https://gitea.vvzvlad.xyz/attachments/7761a23e-4691-4577-8986-123b21aed94f)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vvzvlad/gitmost#124