Break Line and divider Tool for Editor.js.
- Adds an empty block
- Adds a divider block
- Keyboard shortcut
CMD+SHIFT+ENTER
Get the package
$ npm i --save-dev editorjs-break-line
Include module at your application
import BreakLine from 'editorjs-break-line';
You can load a specific version of the package from jsDelivr CDN.
Require this script on a page with Editor.js.
<script src="https://cdn.jsdelivr.net/npm/editorjs-break-line"></script>
Add a new Tool to the tools
property of the Editor.js initial config.
const editor = EditorJS({
tools: {
breakLine: {
class: BreakLine,
inlineToolbar: true,
shortcut: 'CMD+SHIFT+ENTER',
},
}
});
No config params required.
- Add a divider line
Field | Type | Description |
---|---|---|
divider | boolean |
Add a divider line |
Data
{
"type": "breakLine",
"data": {
"divider": true
}
},
Development mode
$ yarn build:dev
Production release
- Create a production bundle
$ yarn build
- Commit
dist/bundle.js
Run tests
$ yarn test
We welcome everyone to contribute. Make sure you have read the CODE_OF_CONDUCT before.
For information on how to contribute, please refer to our CONTRIBUTING guide.
Features and bug fixes are listed in the CHANGELOG file.
This library is licensed under an MIT license. See LICENSE for details.
Made with 💙 by kommitters Open Source