From d924ada5372da12af1bcb613268ec5b8ec710361 Mon Sep 17 00:00:00 2001 From: Liz LeCrone Date: Sun, 1 Sep 2019 10:25:31 -0700 Subject: [PATCH] Fixing js and cleaning up one sentence --- docs/Advanced-Topics-Entities.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/Advanced-Topics-Entities.md b/docs/Advanced-Topics-Entities.md index 157e51b4a2..74b590155f 100644 --- a/docs/Advanced-Topics-Entities.md +++ b/docs/Advanced-Topics-Entities.md @@ -77,9 +77,9 @@ the `getEntityAt()` method on a `ContentBlock` object, passing in the target offset value. ```js +const contentState = editorState.getCurrentContent(); const blockWithLinkAtBeginning = contentState.getBlockForKey('...'); const linkKey = blockWithLinkAtBeginning.getEntityAt(0); -const contentState = editorState.getCurrentContent(); const linkInstance = contentState.getEntity(linkKey); const {url} = linkInstance.getData(); ``` @@ -100,8 +100,7 @@ from the text. Entities with this mutability type are effectively atomic. For instance, in a Facebook input, add a mention for a Page (e.g. Barack Obama). Then, either add a character within the mentioned text, or try to delete a character. -Note that when adding characters, the entity is removed, and when deleting character, -the entire entity is removed. +Note that when adding or deleting characters, the entity is removed. This mutability value is useful in cases where the text absolutely must match its relevant metadata, and may not be altered.