@clefermy/editorjs-spoiler
v1.1.0
Published
Inline tool for hiding text fragments
Downloads
3
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-spoiler
yarn add @clefermy/editorjs-spoiler
Include module at your application
import spoiler from '@clefermy/editorjs-spoiler';
Download to your project's source dir
- Upload folder
dist
from repository - Add
dist/bundle.js
file 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."
}
}