Licence
MIT
Version
0.2.3
Deps
2
Size
19 kB
Vulns
0
Weekly
0
CodeBlock Tool
Provides Headings Blocks for the Editor.js.
Installation
Install via NPM
Get the package
npm i editorjs-codeblockInclude 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}"
}
}