Download the PHP package oberon/quill-rendering without Composer
On this page you can find all versions of the php package oberon/quill-rendering. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oberon/quill-rendering
More information about oberon/quill-rendering
Files in oberon/quill-rendering
Package quill-rendering
Short Description Render 'insert' Delta's of a Quill Editor. Inspired by D. Blackborough's Quill Renderer package
License MIT
Informations about the package quill-rendering
Installation
Use composer
composer require oberon/quill-rendering
Usage
Output should be:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed volutpat lectus non pellentesque volutpat. Phasellus in lectus pulvinar lorem vestibulum pellentesque.
Most important components
-
Renderer
Has function
renderwhich returns a string with formatted contents -
Parser
When given a Quill
opandrenderers[]returntrueifopwas handled and an appropriateRendererwas added to providedrenderers[],falseotherwise
Convenient classes/methods
DefaultHtmlParsers::get() returns a Parser[] for most basic HTML functionality including
- Bold
- Underline
- Strikethrough
- Italic
- Ordered/Unordered lists
- Links
- Images
- Headers
- Sub/SuperScript
HtmlParser::withQuill($quillOps) will render the provided Quill-text with the DefaultHtmlParsers.
Adding a custom Parser and Renderer
Example: You want to use <b> instead of <strong> for bold.
-
Create a Renderer
-
Create a Parser
- Register the Parser with the RenderQuill
Note: This code is an example and needs modification if you would use it. For example: this does not handle cases where the attributes contain bold and some other attribute.
Notes
The load method immediately uses the provided Parsers, so Parsers should be set first.
Other Ops than insert exist: those will not be rendered. Use the Quill-Delta library at https://packagist.org/packages/oberon/quill-delta
All versions of quill-rendering with dependencies
ext-json Version *