EditorJs Data Parser
Easyly convert json data from editorjs to html elements
Installaton
npm i editorjs-data-parser
yarn add editorjs-data-parser
Suppoted tools
-
✅ checklist -
✅ embed -
✅ head -
✅ link -
✅ list -
✅ paragraph -
✅ quote -
✅ raw -
✅ table -
✅ code -
✅ warning -
❎ delimeter (next update)
Usage example
import { edtiorJSParser } from 'editorjs-data-parser';
import EditorJS from "@editorjs/editorjs";
import Header from "@editorjs/header";
import List from "@editorjs/list";
import Embed from "@editorjs/embed";
const editor = new EditorJS({
holderId: "editorJS",
tools: {
header: {
class: Header,
inlineToolbar: ["link"]
},
list: {
class: List,
inlineToolbar: true
},
embed: {
class: Embed,
inlineToolbar: false,
config: {
services: {
youtube: true,
coub: true
}
}
}
}
});
let btnSaves = document.getElementById("btnSaves");
btnSaves.addEventListener("click", () => {
editor.save().then(outputData => {
console.log(edtiorJSParser(outputData.blocks));
});
});
Output will be HTML blocks