Skip to content

fix(editor): resolve code block interaction issues - #635

Merged
murongg merged 2 commits into
v2from
fix/issue-631-code-blocks
Aug 3, 2026
Merged

fix(editor): resolve code block interaction issues#635
murongg merged 2 commits into
v2from
fix/issue-631-code-blocks

Conversation

@murongg

@murongg murongg commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve surrounding rich text when pasted HTML contains both prose and code
  • unwrap fenced code blocks safely when Backspace is pressed at the first code line, including multi-cursor handling
  • add a persistent editor preference for showing code block line numbers, with localized settings copy
  • remove the gutter, divider, and hanging indent across the full code block when line numbers are hidden

Validation

  • cd packages/editor && pnpm test && pnpm build && pnpm typecheck:test passed (413 tests)
  • cd packages/app && pnpm test && pnpm build && pnpm typecheck:test passed (1,484 tests)
  • cd packages/shared && pnpm test passed (62 tests)
  • cd packages/shared && pnpm build passed
  • pnpm build passed for all workspace projects, including web and desktop production builds
  • browser QA confirmed hidden line numbers use a 16px content inset with no pseudo-element, hanging indent, or gutter gradient on the top, content, and closing rows

Risk

  • the new preference defaults to enabled, preserving existing rendering
  • the Backspace handler only intercepts empty selections at the first fenced-code content position; other selections retain standard editor behavior
  • code block gutter styling is now keyed to an explicit renderer state so wrapped rows and block edges change together

Closes #631

Preserve surrounding rich text when pasting mixed HTML, unwrap fenced blocks safely on leading Backspace, and add a persistent code block line-number preference.

Closes #631
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markra-web Ready Ready Preview Aug 3, 2026 2:14am

Keep the code block top gap, content rows, wrapped-line indentation, and closing edge aligned when the line-number preference is disabled.
@murongg
murongg merged commit 015b5ee into v2 Aug 3, 2026
21 checks passed
@murongg
murongg deleted the fix/issue-631-code-blocks branch August 3, 2026 02:15
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.

[Editor]: Code Block : plain text without line number

1 participant