Skip to content

Bug (?): syntax highlighting in code blocks affected by plugin order #7324

@thorn0

Description

@thorn0

Lexical Version: 0.27.2
Behavior changed between: 0.21.0 → 0.22.0
Suspected cause: #6894

Steps To Reproduce

  1. Open: StackBlitz
  2. Notice the code block initially lacks syntax highlighting
  3. Edit the code block; syntax highlighting appears
  4. In Editor.js, move <CodeHighlightPlugin /> above SyncValuePlugin
  5. Observe that syntax highlighting now works from the start

The expected behavior

I expected plugin order not to matter. It's unclear whether there's a problem with my SyncValuePlugin implementation or if this is an unintended regression. The issue began in 0.22.0 and may affect other node transformations. Would appreciate clarification on whether this is expected behavior or a bug.

Update: It also depends on the React version. It works as expected with React 19 (example), but not with React 18.2 (original report).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions