README
slate-better-soft-break
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:
- Disable
\n
in blocks disallowing soft-break - Disable
\n
in inlines
Install
yarn add slate-better-soft-break
Simple Usage
import createSoftBreakPlugin from '../../lib/';
const plugin = createSoftBreakPlugin({
softBreakIn: ['code', 'cell']
});
Options:
softBreakIn: Array<string>
block types allowing the soft-breakshiftIn: Array<string>
(optional) blocks types that enter soft-break with shift+enterignoreWhen(Event, Value) : boolean
: To ignore theonKeyDown
function provided by this plugindeleteAtRange()
(optional): You customized deleteAtRange for insert '\n';