
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
draft-js-list-plugin
Advanced tools
Better lists for Draft.js
*
, 1.
or similarâ Demo
This plugin requires you to have draft-js-plugins
set up in your project.
Install the plugin using NPM:
npm install draft-js-list-plugin
Import the list plugin in your Editor component:
import React, { Component } from "react";
import PluginEditor from "draft-js-plugins-editor";
import createListPlugin from "draft-js-list-plugin";
// ...
const listPlugin = createListPlugin();
const plugins = [listPlugin];
export default class Editor extends Component {
// ...
render() {
const { editorState } = this.state;
return (
<PluginEditor
// ...
editorState={editorState}
plugins={plugins}
/>
);
}
}
See Editor.tsx for a full example.
You can pass options to the plugin the following way:
const listPlugin = createListPlugin({
// Your options
});
Supported options:
allowNestedLists
(boolean
): Whether the user should be able to create sublists (nested lists). Default: true
maxDepth
(number
): Allows you to control how deep the list nesting can be. Default: 4
olRegex
(RegExp
): Regular expression for determining whether a numbered list should be started. Default: /\d\./
ulChars
(string[]
): List of characters with which bullet lists can be started. Default: ["-", "â", "*"]
Requirements: Node.js, Yarn
git clone REPO_URL
yarn
yarn start
localhost:3000
Suggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.
FAQs
Better lists for Draft.js
We found that draft-js-list-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.