@rxpm/fivemin-block-parser
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Fivemin Block Parser

Simply converts Editor.js block data to HTML format.

Requirements

Installation

Add dependency in your existing project.

npm i @rxpm/fivemin-block-parser

Usage

Create a new instance of BlockParser with built-in handlers.

const parser = new BlockParser();

Parse block data using the BlockParser.parse() method and obtain the HTML output.

// Replace the value with your Editor.js output
const blockdata = {
   time: 1696223716589,
   blocks: [
      {
         id: '1yKeXKxN7-',
         type: 'header',
         data: {
            text: 'Hola',
            level: 2
         }
      },
      {
         id: 'mhTl6ghSkV',
         type: 'paragraph',
         data: {
            text: '¡Bienvenido a fivemin.in!'
         }
      }
   ]
};

const html = parser.parse(blockdata);

console.log(html);

For more information or inquiries, please contact the project owner: Rajat (rxx256+github@outlook.com)

Readme

Keywords

Package Sidebar

Install

npm i @rxpm/fivemin-block-parser

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

14.3 kB

Total Files

13

Last publish

Collaborators

  • rxpm