Comments (3)
Here's the small change I made to get it working temporary,
/src/Delta/Html/Video (New Class -> Copy of Image):
<?php
declare(strict_types=1);
namespace DBlackborough\Quill\Delta\Html;
/**
* Default delta class for video inserts
*
* @author Dean Blackborough <[email protected]>
* @copyright Dean Blackborough
* @license https://github.com/deanblackborough/php-quill-renderer/blob/master/LICENSE
*/
class Video extends Delta
{
/**
* Set the initial properties for the delta
*
* @param string $insert
* @param array $attributes
*/
public function __construct(string $insert, array $attributes = [])
{
$this->tag = null;
$this->insert = $insert;
$this->attributes = $attributes;
}
/**
* Render the HTML for the specific Delta type
*
* @return string
*/
public function render(): string
{
return "<iframe src=\"{$this->insert}\" allowfullscreen></iframe>";
}
}
/src/Parser/Parse.php Line 181:
if (isset($quill['insert']['image'])) {
$this->image($quill);
} elseif (isset($quill['insert']['video'])) {
$this->video($quill);
}
/src/Parser/Html.php & Markup.php (New Function + Use):
use DBlackborough\Quill\Delta\Html\Video;
...
/**
* Video, assign to the video Delta.
*
* @param array $quill
*
* @return void
*/
public function video(array $quill)
{
$this->deltas[] = new Video($quill['insert']['video']);
}
from php-quill-renderer.
Cheers @kingga I'll add this into the next release.
from php-quill-renderer.
Image support in v3.13.0, release in the next day or so.
from php-quill-renderer.
Related Issues (20)
- Problems with newlines HOT 8
- How to extend the Parser HOT 9
- Support for complex unknown attributes HOT 1
- Link always gets parsed on new line HOT 14
- wrong output for lists HOT 3
- Option to ignore newline only inserts HOT 1
- Refactoring HOT 1
- Better handle custom attributes HOT 1
- Lots of problems with links HOT 4
- Problem parsing HTML with non standard attribute HOT 2
- Video with attributes not supported HOT 1
- GitHub actions HOT 1
- Code review
- Problem rendering list with a single item HOT 4
- Uncaught Error: Class 'DBlackborough\Quill\Render' not found HOT 1
- Nested lists beta HOT 1
- Markdown renderer and lists HOT 1
- Code duplication HOT 2
- Compound deltas markdown
- Plain text parser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-quill-renderer.