Skip to content

Render quill insert deltas to HTML, additional output formats will be added after the v3.00.0 release

License

Notifications You must be signed in to change notification settings

evrimagaci/php-quill-renderer

 
 

Repository files navigation

Latest Stable Version Packagist License Minimum PHP Version Build Status

PHP Quill Renderer

Render quill insert deltas to HTML, additional output formats will be added after the v3.00.0 release

Description

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.

Planned features

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.

PHP < 7.2

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.

Installation

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.

Usage

try {
    $quill = new \DBlackborough\Quill\Render($quill_json, 'HTML');
    echo $quill->render();
} catch (\Exception $e) {
    echo $e->getMessage();
}

Usage, direct, parse and then render

$parser = new \DBlackborough\Quill\Parser\Html();
$parser->load($quill_json);
$parser->parse();

$renderer = new \DBlackborough\Quill\Renderer\Html($parser->deltas());
echo $renderer->render();

Quill attributes support

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>

Credits

About

Render quill insert deltas to HTML, additional output formats will be added after the v3.00.0 release

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%