# slate-better-soft-break

> Enable soft-break and avoid soft-break at non-soft-break blocks

Latest version **0.0.8** (published 2018-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install slate-better-soft-break
pnpm add slate-better-soft-break
yarn add slate-better-soft-break
bun add slate-better-soft-break
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2018-06-29 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 946.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | zhujinxuan |
| Maintainers | jinxuan |
| Keywords | slate |

## Links

- npm: https://www.npmjs.com/package/slate-better-soft-break
- Repository: https://github.com/zhujinxuan/slate-sensible
- npm.io page: https://npm.io/package/slate-better-soft-break

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 0.0.8 (latest) — 2018-06-29
- 0.0.7 — 2018-06-29
- 0.0.6 — 2018-04-13
- 0.0.5 — 2018-04-06
- 0.0.4 — 2018-03-21
- 0.0.3 — 2018-03-01
- 0.0.2 — 2018-02-27
- 0.0.1 — 2018-02-20

## README

# slate-better-soft-break

[![NPM version](https://badge.fury.io/js/slate-better-soft-break.svg)](http://badge.fury.io/js/slate-better-soft-break)

Allow users to insert `\n` by pressing `enter`, alike [`slate-soft-break`](https://github.com/ianstormtaylor/slate-plugins/tree/master/packages/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';

---
_Source: https://npm.io/package/slate-better-soft-break · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
