contenido
Version:
Contenido is a library with a set of tools to help you create your own rich text editor on top of draft-js without thinking about how to handle things.
21 lines (16 loc) • 414 B
text/typescript
// Core
import { RichUtils } from '../../core';
// Custom Types
import type { State, StateHandler } from '../../types';
const toggleSuperscript = (
state: State,
stateHandler: StateHandler,
customSuperscriptkey?: string
) => {
const updatedStyle = RichUtils.toggleInlineStyle(
state,
customSuperscriptkey || 'SUPERSCRIPT'
);
stateHandler(updatedStyle);
};
export default toggleSuperscript;