The 'editorjs-html' library can help you parse you Json data to HTML. It provides some basic parser functions, but also allows you to override and define your own parser functions. It is framework independent, so you can use it anywhere.

  • https://github.com/pavittarx/editorjs-html

The README repository has some good information, but you can also see some examples here, https://medium.com/@pavittarx/rendering-json-from-editor-js-to-html-bfb615ee78c4

Answer from pavittarx on Stack Overflow
🌐
npm
npmjs.com › package › editorjs-html
editorjs-html - npm
A utility to parse editorjs clean data to HTML.. Latest version: 4.0.5, last published: 8 months ago. Start using editorjs-html in your project by running `npm i editorjs-html`. There are 23 other projects in the npm registry using editorjs-html.
      » npm install editorjs-html
    
Published   Jan 19, 2025
Version   4.0.5
Author   pavittarx
Top answer
1 of 9
18

The 'editorjs-html' library can help you parse you Json data to HTML. It provides some basic parser functions, but also allows you to override and define your own parser functions. It is framework independent, so you can use it anywhere.

  • https://github.com/pavittarx/editorjs-html

The README repository has some good information, but you can also see some examples here, https://medium.com/@pavittarx/rendering-json-from-editor-js-to-html-bfb615ee78c4

2 of 9
11

I found a function to do it and I made a modification of my own. I think it can be improved but right now this is the best that I got.

  convertDataToHtml(blocks) {
      var convertedHtml = "";
      blocks.map(block => {
        
        switch (block.type) {
          case "header":
            convertedHtml += `<h${block.data.level}>${block.data.text}</h${block.data.level}>`;
            break;
          case "embded":
            convertedHtml += `<div><iframe width="560" height="315" src="${block.data.embed}" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>`;
            break;
          case "paragraph":
            convertedHtml += `<p>${block.data.text}</p>`;
            break;
          case "delimiter":
            convertedHtml += "<hr />";
            break;
          case "image":
            convertedHtml += `<img class="img-fluid" src="${block.data.file.url}" title="${block.data.caption}" /><br /><em>${block.data.caption}</em>`;
            break;
          case "list":
            convertedHtml += "<ul>";
            block.data.items.forEach(function(li) {
              convertedHtml += `<li>${li}</li>`;
            });
            convertedHtml += "</ul>";
            break;
          default:
            console.log("Unknown block type", block.type);
            break;
        }
      });
      return convertedHtml;
    }
🌐
Editor.js
editorjs.io
Editor.js
text: "Given data can be used as you want: render with HTML for Web clients, render natively for mobile apps, create the markup for Facebook Instant Articles or Google AMP, generate an audio version, and so on.", } , } , ... Every block is powered by plugins — easy to create your own. Explore dozens of ready-made options for blocks, inline formatting, and block tunes. Editor.js is free and open source.
🌐
GitHub
github.com › pavittarx › editorjs-html
GitHub - pavittarx/editorjs-html: A javascript library to parse editorjs clean data to html. It is adaptable and usable in all kind of projects.
A javascript library to parse editorjs clean data to html. It is adaptable and usable in all kind of projects. - pavittarx/editorjs-html
Starred by 374 users
Forked by 62 users
Languages   TypeScript 95.2% | JavaScript 4.8%
🌐
JSFiddle
jsfiddle.net › wreiske › 5Le9kwcv
EditorJS Rough JSON to HTML Rendering Example - JSFiddle - Code Playground
The Code Completion will now also have the context of all panels before suggesting code to you - so if for example you have some CSS or JS, the HTML panel will suggest code based on the other two panels. Introducing some AI sprinkle in the editor - Code Completion based on the Codestral model ...
🌐
GitHub
github.com › vorjyga › editorjs-to-html
GitHub - vorjyga/editorjs-to-html: parse editorjs content format to html with saving editorjs layouts
An utility to parse editorjs JSON data to HTML code which looks like as you see in editor mode. Supports basic editorjs blocks which are customizable as well.
Starred by 9 users
Forked by 6 users
Languages   CSS 53.7% | TypeScript 44.3% | JavaScript 2.0%
🌐
GitHub
github.com › codex-team › editor.js › issues › 676
JSON to back to html, How? · Issue #676 · codex-team/editor.js
April 3, 2019 - So cool that it outputs clean data... Then how do I convert this clean data to html, so I can, as you say, use it it in a web page? Thanks!
Published   Apr 03, 2019
🌐
Editor.js
editorjs.io › base-concepts
Base concepts
February 8, 2022 - Editor.js is a block-style editor for rich media stories. It outputs clean data in JSON instead of heavy HTML markup. And more important thing is that Editor.js is designed to be API extendable and pluggable.
Find elsewhere
🌐
CodeSandbox
codesandbox.io › examples › package › editorjs-html
editorjs-html examples - CodeSandbox
editor-js-react · hussam23 · suspicious-worker-04kyh · ahmed.sadek.sharoodFind more examples or templates · AboutA utility to parse editorjs clean data to HTML.17,322Weekly Downloads · Latest version4.0.5 · LicenseMIT · External Links ·
🌐
JSFiddle
jsfiddle.net
JSFiddle - Code Playground
The Code Completion will now also have the context of all panels before suggesting code to you - so if for example you have some CSS or JS, the HTML panel will suggest code based on the other two panels. Introducing some AI sprinkle in the editor - Code Completion based on the Codestral model ...
🌐
Runkit
runkit.com › pavittarx › editorjs-html-example
editorjs-html-examples
This is a playground to test JavaScript. It runs a completely standard copy of Node.js on a virtual server created just for you. Every one of npm’s 300,000+ packages are pre-installed, so try it out: // Import editorjs-html library const edjsHTML = require('editorjs-html'); // Initialise a parser object const edjsParser = edjsHTML(); // fetch editorjs cleandata, I will add some sample clean data for this tutorial const cleanData = { blocks: [{ type: 'header', data: { text: 'This is a sample Header', level: 2 } }] } // parse cleanData to HTML const html = edjsParser.parse(cleanData); // display generated HTML, or use it as you'd like.
🌐
jsDelivr
jsdelivr.com › package › npm › editorjs-html-output
editorjs-html-output CDN by jsDelivr - A CDN for npm and GitHub
September 30, 2022 - A free, fast, and reliable CDN for editorjs-html-output. Easily convert json data from editorjs to html elements
Published   Aug 21, 2022
🌐
crates.io
crates.io › crates › editorjs-to-html-converter
editorjs-to-html-converter - crates.io: Rust Package Registry
Convert Editor.js json to raw html · #html · #editorjs · #converter · editorjs-to-html-converter v0.1.0 appears to have no README.md file · about 3 years ago · 2021 edition · MIT OR Apache-2.0 · 101 SLoC · 3.52 KiB · pkg:cargo/[email protected] ·
🌐
GitHub
github.com › codex-team › editor.js › issues › 1232
Is there any library convert html to block of editorjs, or convert block to html · Issue #1232 · codex-team/editor.js
March 31, 2020 - codex-team / editor.js Public · There was an error while loading. Please reload this page. Notifications · You must be signed in to change notification settings · Fork 2.2k · Star 30.7k · New issueCopy link · New issueCopy link · Closed · Closed · Is there any library convert html to block of editorjs, or convert block to html#1232 ·
Published   Jul 14, 2020
🌐
CKEditor
ckeditor.com
WYSIWYG HTML Editor with Collaborative Rich Text Editing
CKEditor is a modern, feature-rich JavaScript editor that's infinitely customizable to build exactly what you need.
🌐
Editor.js
editorjs.io › saving-data
Saving data
February 8, 2022 - } }, { "id": "qYIGsjS5rt", "type": "header", "data": { "text": "Key features", "level": 3 } }, { "id": "XV87kJS_H1", "type": "list", "data": { "style": "unordered", "items": [ "It is a block-styled editor", "It returns clean data output in JSON", "Designed to be extendable and pluggable with a simple API" ] } }, { "id": "AOulAjL8XM", "type": "header", "data": { "text": "What does it mean «block-styled editor»", "level": 3 } }, { "id": "cyZjplMOZ0", "type": "paragraph", "data": { "text": "Workspace in classic editors is made of a single contenteditable element, used to create different HTML markups.
🌐
GitHub
github.com › codex-team › editor.js › discussions › 1875
Import raw HTML on init · codex-team/editor.js · Discussion #1875
For example, pasting <strong>, <em>, <br> or <table> tags doesn't seem to work (even after initializing @editorjs/table). To see what I mean, try using the following as the input for your initEditor function: <html> <body> <h1>This is a heading</h1> <p>This is a normal paragraph.
Author   codex-team
🌐
GitHub
github.com › editor-js › awesome-editorjs
GitHub - editor-js/awesome-editorjs: 🤩 A curated list of awesome Editor.js tools, libraries and resources.
editorjs-to-html — editorjs format parser to html with saving editorjs markup format · editor-js-component - an editorjs library that can use Vue and React frameworks
Starred by 2.7K users
Forked by 217 users
🌐
Quill
quilljs.com
Quill - Your powerful rich text editor
Granular access to the editor's content, changes and events through a simple API. Works consistently and deterministically with JSON as both input and output. Supports all modern browsers on desktops, tablets and phones. Experience the same consistent behavior and produced HTML across platforms.