All Projects → deanblackborough → php-quill-renderer

deanblackborough / php-quill-renderer

Licence: MIT license
Render quill insert deltas to HTML, Markdown and GitHub flavoured Markdown

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to php-quill-renderer

Ngx Quill
Angular (>=2) components for the Quill Rich Text Editor
Stars: ✭ 1,382 (+1081.2%)
Mutual labels:  quill, renderer
navigator-hugo
Navigator Business theme powered by Hugo. It also could be used for a personal portfolio.
Stars: ✭ 133 (+13.68%)
Mutual labels:  mit-license
Samurai
Archived: A Discord bot for BitZeny users.
Stars: ✭ 21 (-82.05%)
Mutual labels:  mit-license
cheetah3
Cheetah3 is a free (MIT) and open source template engine for Python.
Stars: ✭ 106 (-9.4%)
Mutual labels:  mit-license
goma-engine
A simple C++ 3D game engine with Vulkan support.
Stars: ✭ 34 (-70.94%)
Mutual labels:  renderer
exuberant
React filesystem renderer
Stars: ✭ 52 (-55.56%)
Mutual labels:  renderer
rottenjs
An all-in-one (2.6kb) Javascript library for web development
Stars: ✭ 15 (-87.18%)
Mutual labels:  renderer
godot-nightly
A program to download the latest version of Godot Nightly Builds
Stars: ✭ 23 (-80.34%)
Mutual labels:  mit-license
OFOBike
A demo app like OFO Bike in Swift.
Stars: ✭ 18 (-84.62%)
Mutual labels:  mit-license
smtpd
SMTP server (library) for receiving emails, written in pure PHP.
Stars: ✭ 94 (-19.66%)
Mutual labels:  mit-license
HFSM
Hierarchical Finite State Machine Framework
Stars: ✭ 73 (-37.61%)
Mutual labels:  mit-license
lazylead
Eliminate the annoying work within ticketing systems (Jira, GitHub, Trello). Allows automating (without admin access) daily actions like tickets fields verification, email notifications by JQL/GQL, meeting requests to your (or teammates) calendar.
Stars: ✭ 42 (-64.1%)
Mutual labels:  mit-license
zaqar
Email microservice writen in Node.js
Stars: ✭ 52 (-55.56%)
Mutual labels:  renderer
AuroraCMS
The Australian Open Source Content Management System
Stars: ✭ 13 (-88.89%)
Mutual labels:  mit-license
magento-ngrok
Magento 2 module for ngrok.io service support
Stars: ✭ 45 (-61.54%)
Mutual labels:  mit-license
onionSkinRenderer
This is an Onion Skin Renderer for Autodesk Maya
Stars: ✭ 93 (-20.51%)
Mutual labels:  renderer
Minazuki
シンプルな製品アクティベーションシステム「Minazuki」のサーバーサイド実装
Stars: ✭ 16 (-86.32%)
Mutual labels:  mit-license
gsc
embeddable (game) scripting language in C
Stars: ✭ 25 (-78.63%)
Mutual labels:  mit-license
bullshit-detector
🔍 Chráňte vašich blízkych pred nedôveryhodným 🇸🇰 a 🇨🇿 obsahom
Stars: ✭ 24 (-79.49%)
Mutual labels:  mit-license
blue-pair
Simple Bluetooth Android app for handling device discovery and pairing.
Stars: ✭ 52 (-55.56%)
Mutual labels:  mit-license

Latest Stable Version Packagist License Minimum PHP Version Supported PHP Version Supported PHP Version Validate dependencies and run tests

PHP Quill Renderer

Render quill insert deltas to HTML, Markdown and GitHub flavoured Markdown.

Description

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.

v4.00.0 and continued development

I released version 4.00.0 to update dependencies to PHP 7.4 and PHP 8.0. After a hiatus, I'm back to use Quill in commercial projects, so I will be upgrading the library at some point this year.

Initially, the work will be towards supporting PHP 8 and 7.4 features and a general cleanup, the code needs to be updated to be more modular and allow plugins, then you can pick and choose what functions to support.

No timeline, I'm working on this in my limited free time.

Installation

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.

Usage

Via API, single $quill_json

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

echo $result;

Via API, multiple $quill_json, passed in via array

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;

Direct, parse and then render, single $quill_json - updated in v3.10.0

$parser = new \DBlackborough\Quill\Parser\Html();
$renderer = new \DBlackborough\Quill\Renderer\Html();

$parser->load($quill_json)->parse();

echo $renderer->load($parser->deltas())->render();

Direct, parse and then render, multiple $quill_json - updated in v3.10.0

$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();

Quill attributes and text flow support

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 Planned Planned
Indent/Outdent No No Planned Planned
Text direction No No Planned N/A
Color No No Planned N/K
Font No No Planned N/K
Text align No No Planned N/A
Block quote No No Planned Planned
Code block No No Planned Planned
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]

Copyright and license

The deanblackborough/php-quill-renderer library is copyright © Dean Blackborough and licensed for use under the MIT License (MIT).

Credits

  • carlos [Bugfix] v1.01.0.
  • pdiveris [Issue #43] - Null inserts.
  • Mark Davison - Pushed me in the right direction for v3.00.0.
  • tominventisbe [Issue #54] - Parser::load() does not reset the deltas array.
  • tominventisbe [Issue #55] - Image deltas with multiple attributes incorrectly being passed to Compound delta.
  • bcorcoran [Issue #81] - Suggested reverting requirements to necessary requirements.
  • kingga [Issue #86] - Video support.
  • Jonathanm10 [Issue #87] - Newlines proceeding inserts ignored, bug report.
  • raphaelsaunier [Issue #87] - Newlines proceeding inserts ignored, bug location.
  • Basil [Issue #101] - Newline only inserts being ignored by parser.
  • Lee Hesselden [PR #104] - Color delta to allowing spans with a style:color="#xxx" definition. (Feature will be extended by [Issue #106])
  • Alex [PR #112] - Custom attributes assigned to style attribute if sensible.
  • davidraijmakers [Issue #108] - Children not supported with headers.
  • philippkuehn [Issue #109] - Multiple list output incorrect and paragraphs not being closed.
  • mechanicalgux [Issue #117] - Compound deltas don't know that they can be links.
  • Lode Claassen [PR #121] - Missing supported format in exception messages.
  • Lode Claassen [PR #122] - Validation code DRY.
  • Lode Claassen [PR #123] - Allow already decoded json to be passed to parser.
  • Nicholas Humphries [PR #128] - Videos with attributes not supported.
  • hybridvision [Issue #132] - Issue rendering single item lists when they aren't the first content.

Coding standards and documentation credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].