editorjs2html
editorjs2html is a utility that converts Editor.js output into HTML.
Features
- Supports multiple Editor.js block types
- Converts structured JSON data into clean HTML with semantic CSS classes
- Easy to use and integrate into projects
- Includes custom CSS classes for styling flexibility
Supported Block Types
This library supports conversion for the following Editor.js block types with corresponding CSS classes:
| Block Type | Class Name |
|---|---|
| Header | js-head |
| Paragraph | js-para |
| List / Nested List | js-list |
| Table | js-table |
| Quote | js-quote |
| Checklist | js-checklist |
| Code | js-code |
| Link | js-link |
| Inline Text | js-inline |
| Warning | js-warning |
| Image / Simple Image | js-image |
| Embed | js-embed |
| Raw Input | js-raw |
Note: Checklist blocks (js-checklist) contain individual checkbox items each wrapped in a div with the js-checkbox class.
Installation
Usage
Styling
The generated HTML includes semantic CSS classes for each block type, allowing you to apply custom styles. Use the corresponding class names from the Supported Block Types table to target specific elements in your CSS.
Example styling for headers:
}
Styling checklist items:
}
One-Time Setup
Git Message Validator
This repository includes a Git message validator to enforce structured commit messages.
Contributor Setup
To ensure all contributors follow the same commit message format, run:
After setup, commit messages must follow the format:
<type>: <subject>
Example:
feat: add button component
Allowed Commit Types
- feat - New feature implementation
- fix - Bug fixes
- docs - Documentation updates
- style - Code style changes (formatting, missing semicolons, etc.)
- ref - Code refactoring without changing functionality
- test - Adding or updating tests
- rev - Code review changes
- perf - Performance improvements
- proj - Project-related tasks (configuration, build scripts, dependencies, etc.)
- lint - Linting fixes and improvements
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.