Render quill insert deltas to HTML, additional output formats will be added after the v3.00.0 release
Quill deltas renderer, converts deltas to HTML, the Quill attributes supported are listed in the table below, the goal is to eventually support every Quill feature.
Over the next few weeks/months I want to continue adding support for additional Quill features and add additional parsers and renderers, I expect Markdown will be next.
Please use version v1.01.1 or v2.03.1 if you are using a version of PHP below 7.2, versions 1 and 2 are not feature with version 3 and are unlikely to ever be updated, the v3 is so much more flexible.
The easiest way to use the renderer is via composer. composer require deanblackborough/php-quill-renderer
,
alternatively you can include the classes in my src/ directory in your library or app.
try {
$quill = new \DBlackborough\Quill\Render($quill_json, 'HTML');
echo $quill->render();
} catch (\Exception $e) {
echo $e->getMessage();
}
$parser = new \DBlackborough\Quill\Parser\Html();
$parser->load($quill_json);
$parser->parse();
$renderer = new \DBlackborough\Quill\Renderer\Html($parser->deltas());
echo $renderer->render();
Attribute | v1+ | v2+ | v3+ |
---|---|---|---|
Bold | Yes | Yes | Yes |
Italic | Yes | Yes | Yes |
Link | Yes | Yes | Yes |
Strike | Yes | Yes | Yes |
Script:Sub | Yes | Yes | Yes |
Script:Super | Yes | Yes | Yes |
Underline | Yes | Yes | Yes |
Header | Yes | Yes | Yes |
Image | Yes | Yes | Yes |
List | Yes | Yes | Yes |
Indent/Outdent | No | No | Planned |
Text direction | No | No | Planned |
Color | No | No | Planned |
Font | No | No | Planned |
Text align | No | No | Planned |
Block quote | No | No | Planned |
Code block | No | No | Planned |
Attribute | HTML Tag |
---|---|
Bold | <strong> |
Italic | <em> |
Link | <a> |
Strike | <s> |
Script:Sub | <sub> |
Script:Super | <sup> |
Underline | <u> |
Header | <h[n]> |
Image | <img> |
List | <ul> <ol> |
- carlos https://github.com/sald19 [Bugfix] v1.01.0
- pdiveris https://github.com/pdiveris [Issue #43] v2.03.1 - Null inserts