Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
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
The npm package draft-js-list-plugin receives a total of 936 weekly downloads. As such, draft-js-list-plugin popularity was classified as not popular.
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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.