@moxrbe/editorjs-break-line
v1.0.2
Published
BreakLine and divider Tool for Editor.js
Downloads
256
Maintainers
Readme
EditorJS BreakLine Tool
Break Line and divider Tool for Editor.js.
Notes
- Adds an empty block
- Adds a divider block
- Keyboard shortcut
CMD+SHIFT+ENTER
Installation
Install via NPM
Get the package
$ npm i --save-dev editorjs-break-line
Include module at your application
import BreakLine from 'editorjs-break-line';
Load from CDN
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>
Usage
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',
},
}
});
Config Params
No config params required.
Tool's tunes
- Add a divider line
Output data
| Field | Type | Description |
| -------------- | --------- | ------------------------------- |
| divider | boolean
| Add a divider line
Data
{
"type": "breakLine",
"data": {
"divider": true
}
},
Development
Development mode
$ yarn build:dev
Production release
- Create a production bundle
$ yarn build
- Commit
dist/bundle.js
Run tests
$ yarn test
Code of conduct
We welcome everyone to contribute. Make sure you have read the CODE_OF_CONDUCT before.
Contributing
For information on how to contribute, please refer to our CONTRIBUTING guide.
Changelog
Features and bug fixes are listed in the CHANGELOG file.
License
This library is licensed under an MIT license. See LICENSE for details.
Acknowledgements
Made with 💙 by kommitters Open Source