Skip to content
Discussion options

You must be logged in to vote

Slate already handles this automatically! The built-in normalizeNode() merges adjacent text nodes with matching properties during normalization—you likely don't need a custom plugin.

Why you're getting path errors:

  1. Paths become stale after transforms — When you call replaceNodes in normalizeNode, all paths become invalid. You must return immediately after any transform and not call other methods like editor.api.blocks().

  2. Possible Slate version conflicts — This is the #1 cause of path errors in Plate. Add overrides to your package.json:

"overrides": {
  "slate": "0.118.0",
  "slate-dom": "0.117.4",
  "slate-react": "0.117.1"
}

If you still need custom merging, use mergeNodes instead…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nklhtv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant