Stars: 117
Forks: 25
Pull Requests: 77
Issues: 61
Watchers: 7
Last Updated: 2022-11-06 12:16:07
Render quill insert deltas to HTML, Markdown and GitHub flavoured Markdown
License: MIT License
Languages: PHP
Render quill insert deltas to HTML, Markdown and GitHub flavoured Markdown.
It doesn't look like there will be new version of Quill, I've decided to make the repo read-only, I'm not going to dedicate anymore time to this package.
Quill deltas renderer, converts deltas to HTML and Markdown, the Quill attributes supported are listed in the table below, the goal is to eventually support every Quill feature.
Quill is a modern WYSIWYG editor built for compatibility and extensibility.
The easiest way to use the PHP Quill Renderer
is via composer.
composer require deanblackborough/php-quill-renderer
,
alternatively you can include the classes in my src/ directory directly in your
library or app.
try {
$quill = new \DBlackborough\Quill\Render($quill_json);
$result = $quill->render();
} catch (\Exception $e) {
echo $e->getMessage();
}
echo $result;
try {
$quill = new RenderMultiple($quill_json, 'HTML');
$result_one = $quill->render('one');
$result_two = $quill->render('two');
} catch (\Exception $e) {
echo $e->getMessage();
}
echo $result_one;
echo $result_two;
$parser = new \DBlackborough\Quill\Parser\Html();
$renderer = new \DBlackborough\Quill\Renderer\Html();
$parser->load($quill_json)->parse();
echo $renderer->load($parser->deltas())->render();
$parser = new \DBlackborough\Quill\Parser\Html();
$renderer = new \DBlackborough\Quill\Renderer\Html();
$parser->loadMultiple(['one'=> $quill_json_1, 'two' => $quill_json_2)->parseMultiple();
echo $renderer->load($parser->deltasByIndex('one'))->render();
echo $renderer->load($parser->deltasByIndex('two'))->render();
Attribute | v1+ | v2+ | v3 HTML | v3 Markdown |
---|---|---|---|---|
Bold | Yes | Yes | Yes | Yes |
Italic | Yes | Yes | Yes | Yes |
Link | Yes | Yes | Yes | Yes |
Strike | Yes | Yes | Yes | N/A |
Script:Sub | Yes | Yes | Yes | N/A |
Script:Super | Yes | Yes | Yes | N/A |
Underline | Yes | Yes | Yes | N/A |
Header | Yes | Yes | Yes | Yes |
Image | Yes | Yes | Yes | Yes |
Video | No | No | Yes | Yes |
List | Yes | Yes | Yes | Yes |
Child lists | No | No | No | No |
Indent/Outdent | No | No | No | No |
Text direction | No | No | No | N/A |
Color | No | No | No | N/K |
Font | No | No | No | N/K |
Text align | No | No | No | N/A |
Block quote | No | No | No | No |
Code block | No | No | No | No |
Custom attributes | No | No | Yes | N/A |
Line breaks | No | No | Yes | Yes |
Paragraphs | Yes | Yes | Yes | Yes |
Attribute | HTML Tag | Markdown Token |
---|---|---|
Bold | <strong> |
** |
Italic | <em> |
* |
Link | <a> |
[Text](Link) |
Strike | <s> |
|
Script:Sub | <sub> |
|
Script:Super | <sup> |
|
Underline | <u> |
|
Header | <h[n]> |
#[n] |
Image | <img> |
![Image](\path\to\image) |
Video | <iframe> |
![Video](\path\to\video) |
List | <ul> <ol> |
* & [n] |
The deanblackborough/php-quill-renderer library is copyright © Dean Blackborough and licensed for use under the MIT License (MIT).