Skip to content

Conversation

@cyanzhong
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors block-level styling in the CoreEditor to use CodeMirror's BlockWrapper API, which provides better structural wrapping for block elements like tables and code blocks. The changes introduce new helper functions and update existing styling exports to return arrays containing both block wrappers and decorations.

Changes:

  • Added createBlockWrappers function and createBlockPlugin helper to support BlockWrapper creation for block-level elements
  • Refactored createDecos by extracting generic createNodeRanges helper function to reduce code duplication
  • Updated tableStyle and codeBlockStyle exports to arrays containing both block wrapper and decoration plugins

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
CoreEditor/src/styling/matchers/lezer.ts Added createBlockWrappers function and extracted generic createNodeRanges helper to support both decorations and block wrappers
CoreEditor/src/styling/helper.ts Added createBlockPlugin function following the same pattern as existing createDecoPlugin
CoreEditor/src/styling/nodes/table.ts Changed tableStyle from single plugin to array with block wrapper and line decoration
CoreEditor/src/styling/nodes/code.ts Changed codeBlockStyle from single plugin to IIFE-wrapped array, moving HTML attributes from line decoration to block wrapper

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cyanzhong cyanzhong merged commit 205a8ad into main Jan 13, 2026
7 checks 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