mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-27 09:04:31 +02:00
chore: rename imageElmnts to imageElements in 04-transforms.md (#5431)
It will make code more readable and character difference is very less so it's worth changing.
This commit is contained in:
@@ -22,12 +22,12 @@ Non-standard operations (or debugging/tracing which Nodes will be affected by a
|
|||||||
For example, to replace all image elements with their alt text:
|
For example, to replace all image elements with their alt text:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const imageElmnts = Editor.nodes(editor, {
|
const imageElements = Editor.nodes(editor, {
|
||||||
at: [], // Path of Editor
|
at: [], // Path of Editor
|
||||||
match: (node, path) => 'image' === node.type,
|
match: (node, path) => 'image' === node.type,
|
||||||
// mode defaults to "all", so this also searches the Editor's children
|
// mode defaults to "all", so this also searches the Editor's children
|
||||||
})
|
})
|
||||||
for (const nodeEntry of imageElmnts) {
|
for (const nodeEntry of imageElements) {
|
||||||
const altText =
|
const altText =
|
||||||
nodeEntry[0].alt ||
|
nodeEntry[0].alt ||
|
||||||
nodeEntry[0].title ||
|
nodeEntry[0].title ||
|
||||||
|
Reference in New Issue
Block a user