{"id":13770484,"url":"https://github.com/pavittarx/editorjs-html","last_synced_at":"2025-05-15T17:05:53.550Z","repository":{"id":37844520,"uuid":"259188294","full_name":"pavittarx/editorjs-html","owner":"pavittarx","description":"A javascript library to parse editorjs clean data to html. It is adaptable and usable in all kind of projects.","archived":false,"fork":false,"pushed_at":"2025-01-23T08:25:01.000Z","size":196,"stargazers_count":351,"open_issues_count":1,"forks_count":61,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-14T12:19:22.358Z","etag":null,"topics":["editor","editorjs","editorjs-html","html","javascript","javascript-library","nodejs","react","rendering","vue"],"latest_commit_sha":null,"homepage":"https://runkit.com/pavittarx/editorjs-html-example","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pavittarx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":"pavittarx","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.buymeacoffee.com/pavittarx"}},"created_at":"2020-04-27T02:52:03.000Z","updated_at":"2025-05-11T10:03:40.000Z","dependencies_parsed_at":"2025-01-11T09:08:17.715Z","dependency_job_id":"4580b8da-9c8d-47a7-8d83-e45389d07967","html_url":"https://github.com/pavittarx/editorjs-html","commit_stats":{"total_commits":55,"total_committers":13,"mean_commits":4.230769230769231,"dds":0.5636363636363637,"last_synced_commit":"1bebffd0fa097ec348be1f9166a3ba886ccf0dba"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavittarx%2Feditorjs-html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavittarx%2Feditorjs-html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavittarx%2Feditorjs-html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavittarx%2Feditorjs-html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavittarx","download_url":"https://codeload.github.com/pavittarx/editorjs-html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254164545,"owners_count":22025400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["editor","editorjs","editorjs-html","html","javascript","javascript-library","nodejs","react","rendering","vue"],"created_at":"2024-08-03T17:00:38.120Z","updated_at":"2025-05-15T17:05:48.536Z","avatar_url":"https://github.com/pavittarx.png","language":"TypeScript","readme":"# editorjs-html\n\nA utility to parse editorjs clean data to HTML.\n\n- Use it with plain Javascript/Typescript, React, Angular, Vue or any templating engine/framework of your choice.\n- Fast, Efficient and Lightweight.\n- Fully customizable to the core.\n- Supports basic editorjs blocks which are customizable as well.\n- Extend to parse your own blocks.\n\n### Whats' new in v4?\n\n- Complete Rewrite, latest dependencies with minimal API changes.\n- Redundant `parseStrict()` and `validate()` functions are removed.\n- Strict mode is configurable via options.\n- Console errors if parser functions for block is not avaiable. Strict Mode throws errors.\n- Code is more readable, modular. It would make it easier to contribute and track changes.\n- Type definitions directly fetched from Editor.js, so development becomes easier.\n- Unit Testing with Jest.\n\n# Installation\n\n### Self Host, precompiled versions.\n\n- **Browser** - [Get /.build/edjsHTML.browser.js](./.build/edjsHTML.browser.js)\n\n- **NodeJs** - [Get /.build/edjsHTML.node.js](./.build/edjsHTML.node.js)\n\n- **For Both Browser \u0026 Node** - [Get /.build/edjsHTML.js](./.build/edjsHTML.js)\n\n### NPM\n\n```shell\nnpm install editorjs-html\n```\n\n### CDN\n\n- https://cdn.jsdelivr.net/npm/editorjs-html@4.0.0/.build/edjsHTML.js\n- (Browser Only Build): https://cdn.jsdelivr.net/npm/editorjs-html@4.0.0/.build/edjsHTML.browser.js\n\n## Usage\n\n### Browser\n\n```js\nconst edjsParser = edjsHTML();\nlet html = edjsParser.parse(editorjs_clean_data);\nconsole.log(html);\n```\n\n### Nodejs\n\n```js\nconst edjsHTML = require(\"editorjs-html\");\nconst edjsParser = edjsHTML();\nconst html = edjsParser.parse(editorjs_clean_data);\n\nconsole.log(html);\n```\n\n## Updates\n\nSee [Releases](https://github.com/pavittarx/editorjs-html/releases)\n\n## Docs\n\n### Supported Block Types\n\n- Header (H1-H6)\n- Lists (Ordered \u0026 Unordered)\n- Nested Lists\n- Image\n- Delimiter\n- Paragraph\n- Quote\n- Code\n- Embed\n\n## Parse Entire EditorJS Data Object\n\n```js\nconst edjsParser = edjsHTML();\nconst HTML = edjsParser.parse(editorjs_data);\n// returns array of html strings per block\nconsole.log(HTML);\n```\n\n## Parse Entire EditorJS Data Object (Strict Mode)\n\n```js\nconst edjsParser = edjsHTML();\nconst HTML = edjsParser.parse(editorjs_data);\n// returns an error\nif (HTML instanceof Error) throw HTML;\n\n// in case of success, returns an array of strings\nconsole.log(HTML);\n```\n\n## Parse Single Clean Data Block\n\n```js\nconst edjsParser = edjsHTML();\nconst blockHTML = edjsParser.parseBlock(editorjs_data_block);\n// returns string of html for this block\nconsole.log(blockHTML);\n```\n\n## Strict Mode\n\n```js\nconst edjsParser = edjsHTML({}, { strict: true });\n// returns the list of missing parser functions\nconst blockHTML = edjsParser.parse(editorjs_data);\nconsole.log(blockHTML);\n```\n\n### Extend For Custom Blocks\n\n`editorjs-html` supports extending and overriding parser functions for blocks.\n\n```js\n  // Example Custom or Unrecognised Block\n  {\n    type: \"custom\",\n    data: {\n      text: \"Hello World\"\n    }\n }\n\n```\n\n```js\n// Parse this block in editorjs-html\nfunction customParser(block) {\n  return `\u003ccustom-tag\u003e ${block.data.text} \u003c/custom-tag\u003e`;\n}\n\nconst plugins = {\n  // The keyname must match with the type of block you want to parse with this funcion\n  custom: customParser,\n  // ... add more or overwrite\n};\n\nconst edjsParser = edjsHTML(plugins);\n```\n\n## Contribution\n\nPlease add an issue, or open a PR for any bugs, review or suggestions.\n\n### New Parser Functions\n\n1. For additional parser functions, please add them to `parsers/block-name`. Check existing functions for suggestions.\n2. Test everyting works fine, with `pnpm test` \u0026\u0026 `pnpm build`.\n3. Open a PR, for review.\n4. Add tests in `tests` directory. Make sure your tests pass with appropriate coverage.\n\n## Suggestions \u0026 Recommendations\n\nI would love to have your feedback and any suggestions. You can also let me know, if you need support for any more editorjs blocks.\n\n## Support\n\nIf you find this helpful, consider giving this repository a Star. You can also buy me a coffee [here](https://www.buymeacoffee.com/pavittarx)\n\n## License\n\nMIT Public License\n\n## Author\n\n[@pavittarx](https://github.com/pavittarx)\n","funding_links":["https://patreon.com/pavittarx","https://www.buymeacoffee.com/pavittarx"],"categories":["TypeScript","Libraries"],"sub_categories":["JavaScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavittarx%2Feditorjs-html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavittarx%2Feditorjs-html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavittarx%2Feditorjs-html/lists"}