Inline tool for overlining text fragments for the Editor.js
Get the package
npm i --save editorjs-overline-by-reregaga
yarn add editorjs-overline-by-reregaga
Include module at your application
import Overline from 'editorjs-overline-by-reregaga';
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
You can load the package from jsDelivr CDN and require the script on a page with Editor.js.
<script src="https://cdn.jsdelivr.net/npm/editorjs-overline-by-reregaga@latest"></script>
Add a new Tool to the tools
property of the Editor.js initial config.
import EditorJs from '@editorjs/editorjs';
import Overline from 'editorjs-overline-by-reregaga';
var editor = new EditorJS({
// ...
tools: {
// ...
overline: Overline
},
});
This Tool has no config params
Underlined text will be wrapped with a span
tag with an reregaga-overline
class.
{
"type" : "text",
"data" : {
"text" : "Create a directory for your module, enter it and run <span class=\"reregaga-overline\">npm init</span> command."
}
}