draft-js-modifiers
Version:
Modular state modifiers for Draft.js
11 lines (9 loc) • 359 B
JavaScript
import { EditorState, RichUtils } from 'draft-js';
var removeBlockStyle = function removeBlockStyle(editorState) {
var withoutBlockStyle = RichUtils.tryToRemoveBlockStyle(editorState);
if (withoutBlockStyle) {
return EditorState.push(editorState, withoutBlockStyle, 'change-block-type');
}
return editorState;
};
export default removeBlockStyle;