editorjs-codeblock
v0.2.3
Published
![Version of EditorJS that the plugin is compatible with](https://badgen.net/badge/Editor.js/v2.0/blue)
Downloads
3
Maintainers
Readme
CodeBlock Tool
Provides Headings Blocks for the Editor.js.
Installation
Install via NPM
Get the package
npm i editorjs-codeblock
Include module at your application
import CodeBlock from "codeblock"
Usage
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
CodeBlock: CodeBlock,
},
...
});
Output data
| Field | Type | Description |
| ----- | -------- | ------------------------------------------------ |
| code | string
| source code in editor |
{
"type": "CodeBlock",
"data": {
"code": "function hello() {\n\talert('Hello world!');\n}"
}
}