@clefermy/editorjs-spoiler
v1.1.0
Published
Inline tool for hiding text fragments
Downloads
17
Maintainers
Readme
spoiler Tool
Inline tool for hiding text fragments for the Editor.js
Installation
Install via NPM
Get the package
npm i --save @clefermy/editorjs-spoileryarn add @clefermy/editorjs-spoilerInclude module at your application
import spoiler from '@clefermy/editorjs-spoiler';Download to your project's source dir
- Upload folder
distfrom repository - Add
dist/bundle.jsfile to your page.
Usage
Add a new Tool to the tools property of the Editor.js initial config.
import EditorJs from '@clefermy/editorjs';
import spoiler from '@clefermy/editorjs-spoiler';
var editor = new EditorJS({
// ...
tools: {
// ...
spoiler: spoiler
},
});Config Params
This Tool has no config params
Output data
spoilerd text will be wrapped with a span tag with an cdx-spoiler class.
{
"type" : "text",
"data" : {
"text" : "Create a directory for your module, enter it and run <span class=\"cdx-spoiler\">npm init</span> command."
}
}