Raw Tool for the Editor.js allows to include raw HTML code in your articles.
Get the package
npm i --save-dev @editorjs/rawInclude module at your application
const RawTool = require('@editorjs/raw');- Upload folder
distfrom repository - Add
dist/bundle.jsfile to your page.
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/@editorjs/raw
Require this script on a page with CodeX Editor.
<script src="..."></script>Add a new Tool to the tools property of the CodeX Editor initial config.
var editor = CodexEditor({
...
tools: {
...
raw: RawTool,
}
...
});| Field | Type | Description |
|---|---|---|
| placeholder | string |
Raw Tool's placeholder string |
This Tool returns raw HTML code.
{
"type" : "raw",
"data" : {
"html": "<div style=\"background: #000; color: #fff; font-size: 30px; padding: 50px;\">Any HTML code</div>",
}
}