Skip to content

Instantly share code, notes, and snippets.

@schabluk
Created June 27, 2017 21:49
Show Gist options
  • Save schabluk/1e382a2f8d11ed4605500542263632be to your computer and use it in GitHub Desktop.
Save schabluk/1e382a2f8d11ed4605500542263632be to your computer and use it in GitHub Desktop.
draft-js findStyleRanges
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