[READ-ONLY] Mirror of https://github.com/Schniz/draft-js-lister-plugin. automatic unordered and ordered lists in draftjs based on draft-js-plugins
0

Configure Feed

Select the types of activity you want to include in your feed.

JavaScript 91.7%
Other 8.3%
7 1 1

Clone this repository

https://tangled.org/schlez.in/draft-js-lister-plugin https://tangled.org/did:plc:e3veook6dm63wimqff64ta4n
git@tangled.org:schlez.in/draft-js-lister-plugin git@tangled.org:did:plc:e3veook6dm63wimqff64ta4n

For self-hosted knots, clone URLs may differ based on your setup.



README.md

draft-js-lister-plugin#

Adds support for automatic ul and ol in your draft-js-plugins <Editor />!

kaki

Support#

  • Starting a line with - or * and space afterwards, creates a new ul.
  • Starting a line with a <NUMBER>.<SPACE> creates a new ol.
  • Pasting from text editors works too

Installation 🍔#

npm install --save draft-js-lister-plugin

Usage:#

import React from 'react';
import Editor from 'draft-js-plugins-editor';
import createListerPlugin from 'draft-js-lister-plugin';

const listerPlugin = createListerPlugin();

const MyEditor = ({ editorState, onChange }) => (
  <div>
    <Editor
      editorState={ editorState }
      onChange={ onChange }
      plugins={ [listerPlugin] }
    />
    <EmojiSuggestions />
  </div>
);

export default MyEditor;