1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 23:12:52 +02:00

Add renderText and leafPosition (#5850)

* feat

* revert

* revert

* docs

* test

* refactor

* test

* revert

* refactor

* doc

* docs

* refactor

* docs

* test

* docs

* docs

* docs

* refactor
This commit is contained in:
Ziad Beyens
2025-04-29 16:30:57 +02:00
committed by GitHub
parent 2c62e01797
commit 22a3dda36d
20 changed files with 390 additions and 117 deletions

View File

@@ -0,0 +1,6 @@
---
'slate-react': minor
---
- Update `RenderLeafProps` interface to add `leafPosition` property containing `start`, `end`, `isFirst`, and `isLast` when a text node is split by decorations.
- Add optional `renderText` prop to `<Editable />` component for customizing text node rendering.

5
.changeset/slate.md Normal file
View File

@@ -0,0 +1,5 @@
---
'slate': minor
---
- Update `Text.decorations` to return the positions in addition to the leaf nodes: `{ leaf: Text, position?: { start: number, end: number, isFirst: boolean, isLast: boolean } }[]`.