slate-better-soft-break
v0.0.8
Published
Enable soft-break and avoid soft-break at non-soft-break blocks
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
\nin blocks disallowing soft-break - Disable
\nin inlines
Install
yarn add slate-better-soft-breakSimple 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 theonKeyDownfunction provided by this plugindeleteAtRange()(optional): You customized deleteAtRange for insert '\n';
