From 507925ad60638734872dba52efa2d0b66cd94e4b Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Wed, 19 Apr 2017 10:56:36 -0700 Subject: [PATCH] Docs tweaks (#1139) * Docs tweaks - Fix reference to older contentState - Change `href` to `url` for consistency with "link" example in case people copy-paste between both (which I did today) - Fix indentation in README * Update Advanced-Topics-Entities.md --- README.md | 2 +- docs/Advanced-Topics-Entities.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e23e4743f5..adb4d820c4 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ class MyEditor extends React.Component { } render() { return ( - + ); } } diff --git a/docs/Advanced-Topics-Entities.md b/docs/Advanced-Topics-Entities.md index c752f1660d..69bfd485dc 100644 --- a/docs/Advanced-Topics-Entities.md +++ b/docs/Advanced-Topics-Entities.md @@ -66,11 +66,11 @@ const contentState = editorState.getCurrentContent(); const contentStateWithEntity = contentState.createEntity( 'LINK', 'MUTABLE', - {href: 'http://www.zombo.com'} + {url: 'http://www.zombo.com'} ); const entityKey = contentStateWithEntity.getLastCreatedEntityKey(); const contentStateWithLink = Modifier.applyEntity( - contentState, + contentStateWithEntity, selectionState, entityKey ); @@ -85,7 +85,7 @@ const blockWithLinkAtBeginning = contentState.getBlockForKey('...'); const linkKey = blockWithLinkAtBeginning.getEntityAt(0); const contentState = editorState.getCurrentContent(); const linkInstance = contentState.getEntity(linkKey); -const {href} = linkInstance.getData(); +const {url} = linkInstance.getData(); ``` ## "Mutability"