Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

draft-js-clear-formatting

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draft-js-clear-formatting

Clear all formatting helper for DraftJS

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Draft.js Clear Formatting

This package is a helper function for Draft JS users. It allows you toclear formatting in selected text in your app. You can choose to remove the following edits:

  • Inline styles(bold, italic, underline)
  • Entities(images, links etc.)
  • Lists(orders, unorderes)

For more details checks configuration section below

Usage

npm i --save draft-js-clear-formatting

then import the function

import clearFormatting from 'draft-js-clear-formatting'
import Editor from 'draft-js-plugins-editor'

const newEditorState = clearFormatting(editorState, options)

Options object

You can pass options object to the function. This object is not required. By default all options set to true.

const options = {
  inline: true,
  entities: true,
  lists: true,
}
OptionDescriptionDefault value
inlineRemoves all inline stylestrue
entitiesRemoves all entitiestrue
listsRemoves all liststrue

TO DO

  • Add tests

Keywords

FAQs

Package last updated on 14 Jan 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc