Skip to content

[lexical-website] Documentation Update: node-replacement config uses nodes:, not nodes= - #9203

Merged
etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-node-replacement-nodes-key
Sep 23, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
potatowagon:docs-node-replacement-nodes-key

Conversation

@potatowagon

Copy link
Copy Markdown
Contributor

Description

The Node Replacement example writes the editor config's node array with =
inside an object literal:

const editorConfig = {
    ...
    nodes=[

That is a syntax error — nodes is a property of CreateEditorArgs, so it
takes :. The replace / with / withKlass entries in the same object are
correct; only the key assignment is wrong.

Test plan

Documentation-only change (markdown is excluded from prettier via
.prettierignore), so the check is that the snippet parses as an object
literal.

Before

$ sed -n '26,29p' packages/lexical-website/docs/concepts/node-replacement.md
const editorConfig = {
    ...
    nodes=[
        // Don't forget to register your custom node separately!

$ node -e "const editorConfig = { nodes=[] }"
SyntaxError: Invalid shorthand property initializer

After

$ sed -n '26,29p' packages/lexical-website/docs/concepts/node-replacement.md
const editorConfig = {
    ...
    nodes: [
        // Don't forget to register your custom node separately!

$ node -e "const editorConfig = { nodes: [] }; console.log('ok')"
ok

Matches CreateEditorArgs.nodes at packages/lexical/src/LexicalEditor.ts:471.

…nodes:, not nodes=

## Description

The Node Replacement example writes the editor config's node array with `=`
inside an object literal:

```ts
const editorConfig = {
    ...
    nodes=[
```

That is a syntax error — `nodes` is a property of `CreateEditorArgs`, so it
takes `:`. The `replace` / `with` / `withKlass` entries in the same object are
correct; only the key assignment is wrong.

## Test plan

Documentation-only change (markdown is excluded from prettier via
`.prettierignore`), so the check is that the snippet parses as an object
literal.

### Before

```
$ sed -n '26,29p' packages/lexical-website/docs/concepts/node-replacement.md
const editorConfig = {
    ...
    nodes=[
        // Don't forget to register your custom node separately!

$ node -e "const editorConfig = { nodes=[] }"
SyntaxError: Invalid shorthand property initializer
```

### After

```
$ sed -n '26,29p' packages/lexical-website/docs/concepts/node-replacement.md
const editorConfig = {
    ...
    nodes: [
        // Don't forget to register your custom node separately!

$ node -e "const editorConfig = { nodes: [] }; console.log('ok')"
ok
```

Matches `CreateEditorArgs.nodes` at `packages/lexical/src/LexicalEditor.ts:471`.
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
lexical Ready Ready Preview Sep 23, 2026 6:33am UTC
lexical-playground Ready Ready Preview Sep 23, 2026 6:33am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 23, 2026
@etrepum
etrepum added this pull request to the merge queue Sep 23, 2026
Merged via the queue into meta:main with commit da12122 Sep 23, 2026
42 checks passed
@etrepum etrepum mentioned this pull request Sep 28, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — 63b1a74b Deployed Sep 23, 2026 by vercel[bot]
Preview – lexical-playground — 63b1a74b Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants