Created
June 27, 2017 21:49
-
-
Save schabluk/1e382a2f8d11ed4605500542263632be to your computer and use it in GitHub Desktop.
draft-js findStyleRanges
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stylesFilter = v => v.hasStyle('HIGHLIGHT') | |
editorState.getCurrentContent().getBlockForKey(anchorKey).findStyleRanges(stylesFilter, (start, end) => { | |
contentState = removeStyle(contentState, anchorKey, start, end, 'HIGHLIGHT') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment