Offer inline code in step lines, like Editor.js does (#54) #59

Merged
miko merged 1 commit from feature/54-inline-tools-step-lines into development 2026-11-03 15:20:33 +01:00
Owner

Closes #54

Step lines had bold, italic and links, but not Editor.js's fourth inline tool, inline code. Step lines aren't an Editor.js block (ADR-0005), so the line editor gets its own version.

  • Editor (StepLinesEditor.tsx): an inline code button in the line toolbar and Editor.js's Ctrl/Cmd+Shift+M shortcut. Like inlineCodeTool.ts, they wrap the selection, unwrap an inline code it is in, and never nest one.
  • Saving (stepLines.ts): parseLineText keeps <code> instead of stripping it. Search and annotation labels use the plain text, so no markup shows there.
  • Styling (globals.css): code in the reading view and in the line editor looks like code in rich text. The rich text code rules were merged into one shared rule.

Tests

  • Unit: stepLinesFromSubmission keeps <code>.
  • E2E: one word is formatted with the button and one with the shortcut, and the reading view shows both as code.

Both failed before the change. All 286 unit and 16 e2e tests pass.

Left out

  • The no-nesting rule exists in two places, toggleInlineCode and inlineCodeTool.ts.
  • Only the editor prevents nested code. The server doesn't reject it, same as for Editor.js content.

🤖 Generated with Claude Code

Closes #54 Step lines had bold, italic and links, but not Editor.js's fourth inline tool, inline code. Step lines aren't an Editor.js block (ADR-0005), so the line editor gets its own version. - **Editor** (`StepLinesEditor.tsx`): an inline code button in the line toolbar and Editor.js's Ctrl/Cmd+Shift+M shortcut. Like `inlineCodeTool.ts`, they wrap the selection, unwrap an inline code it is in, and never nest one. - **Saving** (`stepLines.ts`): `parseLineText` keeps `<code>` instead of stripping it. Search and annotation labels use the plain text, so no markup shows there. - **Styling** (`globals.css`): code in the reading view and in the line editor looks like code in rich text. The rich text code rules were merged into one shared rule. ## Tests - Unit: `stepLinesFromSubmission` keeps `<code>`. - E2E: one word is formatted with the button and one with the shortcut, and the reading view shows both as code. Both failed before the change. All 286 unit and 16 e2e tests pass. ## Left out - The no-nesting rule exists in two places, `toggleInlineCode` and `inlineCodeTool.ts`. - Only the editor prevents nested code. The server doesn't reject it, same as for Editor.js content. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Step lines had bold, italic and links but not Editor.js's fourth inline
tool, inline code. The line editor gets an inline code button and
Editor.js's Ctrl/Cmd+Shift+M shortcut, which wrap the selection, unwrap
an inline code it is in, and never nest one. Step line text now keeps
<code> when it is sanitised, and the reading view and the line editor
style it like rich text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit b2cb605d7b into development 2026-11-03 15:20:33 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!59
No description provided.