slate-better-soft-break

0.0.8 • Public • Published

slate-better-soft-break

NPM version

Allow users to insert \n by pressing enter, alike slate-soft-break

Why this plugin

slate-soft-break allows \n into un-wanted blocks or inlines by paste. Therefore, slate-better-soft-break provide normalization to ensure:

  1. Disable \n in blocks disallowing soft-break
  2. Disable \n in inlines

Install

yarn add slate-better-soft-break

Simple Usage

import createSoftBreakPlugin from '../../lib/';
const plugin = createSoftBreakPlugin({
    softBreakIn: ['code', 'cell']
});

Options:

  1. softBreakIn: Array<string> block types allowing the soft-break
  2. shiftIn: Array<string> (optional) blocks types that enter soft-break with shift+enter
  3. ignoreWhen(Event, Value) : boolean: To ignore the onKeyDown function provided by this plugin
  4. deleteAtRange()(optional): You customized deleteAtRange for insert '\n';

Readme

Keywords

Package Sidebar

Install

npm i slate-better-soft-break

Weekly Downloads

2

Version

0.0.8

License

MIT

Unpacked Size

969 kB

Total Files

16

Last publish

Collaborators

  • jinxuan