@draft-js-enhance-plugins/inline-code
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

DraftJS Inline Code Plugin

This is a plugin for the @draft-js-plugins/editor.

Feature

  • Selection always enclosed with spaces

  • Automatically remove inline styles except CODE style

TODO

  • [ ] Custom the customStyleMap

Usage

import { EditorState } from 'draft-js';
import Editor from '@draft-js-plugins/editor';
import createInlineCodePlugin from '@draft-js-enhance-plugins/inline-code';

const inlineCodePlugin = createInlineCodePlugin();

const plugins = [inlineCodePlugin];

function Example() {
  const [editorState, setEditorState] = useState(EditorState.createEmpty());

  return (
    <Editor
      editorState={editorState}
      onChange={setEditorState}
      plugins={plugins}
    />
  );
}

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @draft-js-enhance-plugins/inline-code

      Weekly Downloads

      1

      Version

      1.0.1

      License

      MIT

      Unpacked Size

      8.31 kB

      Total Files

      6

      Last publish

      Collaborators

      • varieget