1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 18:39:51 +02:00

Docs: fix incorrect name. (#5182)

A reference to the sample above incorrectly mentions `Editor.unwrapNodes` instead of `Transforms.unwrapNodes`.
This commit is contained in:
Jacob Carpenter
2022-11-08 04:38:52 -08:00
committed by GitHub
parent 346f6572fc
commit d8dbbb19f7

View File

@@ -76,7 +76,7 @@ You might at first think this is odd, because with the `return` there, the origi
But, there's a slight "trick" to normalizing.
When you do call `Editor.unwrapNodes`, you're actually changing the content of the node that is currently being normalized. So even though you're ending the current normalization pass, by making a change to the node you're kicking off a _new_ normalization pass. This results in a sort of _recursive_ normalizing.
When you do call `Transforms.unwrapNodes`, you're actually changing the content of the node that is currently being normalized. So even though you're ending the current normalization pass, by making a change to the node you're kicking off a _new_ normalization pass. This results in a sort of _recursive_ normalizing.
This multi-pass characteristic makes it _much_ easier to write normalizations, because you only ever have to worry about fixing a single issue at once, and not fixing _every_ possible issue that could be putting a node in an invalid state.