Skip to content

Commit 20e1cc0

Browse files
lizlecronemmissey
authored andcommitted
Fixing js example and cleaning up one sentence (facebookarchive#2172)
Summary: **Summary** Cleaning up JS example to have proper order. Cleaning up sentence to be clearer. **Test Plan** NA Pull Request resolved: facebookarchive#2172 Differential Revision: D17306067 Pulled By: Daniel15 fbshipit-source-id: 25d94313dde4157dbea192007ece110add9d5360
1 parent 1ee7a2a commit 20e1cc0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/Advanced-Topics-Entities.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ the `getEntityAt()` method on a `ContentBlock` object, passing in the target
7777
offset value.
7878

7979
```js
80+
const contentState = editorState.getCurrentContent();
8081
const blockWithLinkAtBeginning = contentState.getBlockForKey('...');
8182
const linkKey = blockWithLinkAtBeginning.getEntityAt(0);
82-
const contentState = editorState.getCurrentContent();
8383
const linkInstance = contentState.getEntity(linkKey);
8484
const {url} = linkInstance.getData();
8585
```
@@ -100,8 +100,7 @@ from the text. Entities with this mutability type are effectively atomic.
100100

101101
For instance, in a Facebook input, add a mention for a Page (e.g. Barack Obama).
102102
Then, either add a character within the mentioned text, or try to delete a character.
103-
Note that when adding characters, the entity is removed, and when deleting character,
104-
the entire entity is removed.
103+
Note that when adding or deleting characters, the entity is removed.
105104

106105
This mutability value is useful in cases where the text absolutely must match
107106
its relevant metadata, and may not be altered.

0 commit comments

Comments
 (0)