composer require setono/editorjs-php
Here is a full example going from json to html output.
<?php
use Setono\EditorJS\Parser\Parser;
use Setono\EditorJS\Renderer\Renderer;
$json = '...'; // this is the actual json you receive from the EditorJS instance
$parser = new Parser();
$parserResult = $parser->parse($json);
$renderer = new Renderer();
$renderer->add(new DelimiterBlockRenderer());
$renderer->add(new HeaderBlockRenderer());
$renderer->add(new ImageBlockRenderer());
$renderer->add(new ListBlockRenderer());
$renderer->add(new ParagraphBlockRenderer());
$renderer->add(new RawBlockRenderer());
$html = $renderer->render($parserResult);
- attaches
- checklist
- code
- delimiter
- embed
- header
- image
- inline-code
- link
- link-autocomplete
- list
- marker
- nested-list
- paragraph
- personality
- quote
- raw
- simple-image
- table
- underline
- warning
A PR adding support for any of the above plugins would be awesome! Thank you 🎉