0.2.3 • Published 1 year ago
editorjs-codeblock v0.2.3
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}"
}
}