Skip to content

feat: code blocks start on ```, stay apart, and Shift+Down steps out - #114

Merged
ttncode merged 2 commits into
mainfrom
feat/notion-code-blocks
Dec 2, 2026
Merged

ttncode merged 2 commits into
mainfrom
feat/notion-code-blocks

Conversation

@ttncode

@ttncode ttncode commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Change

  • Typing ``` on an empty body line makes a code block at once, without Enter or Space.
  • A block started that way next to another code block stays separate. It is marked with data-block-start, which codeBlockLines, the CSS, sanitize and copy all read. Moving, duplicating, inserting and splitting lines keep the marker in the right place.
  • Shift+Down in code leaves the block onto a body line below it. The text after the caret and the code lines under it come out too (leaveCodeBlock in app/lines.js).
  • Enter in code always adds a code line. The "two blank lines" exit and its helpers are removed.

Also releases v0.2.0.

Testing

  • node --test tests/*.test.js: 252 pass.
  • Not checked in a running app. The unit-test DOM (linkedom) has no keyboard or selection handling. Try ```, Enter, Shift+Down and Alt+Up/Down between touching blocks in the installer.

Typing ``` makes a code block at once and it no longer merges with a
block next to it. Enter always adds a code line; Shift+Down leaves the
block, taking the code after the caret with it.
@ttncode
ttncode merged commit b543436 into main Dec 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants