Giter Club home page Giter Club logo

Comments (3)

kingga avatar kingga commented on September 13, 2024

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.

deanblackborough avatar deanblackborough commented on September 13, 2024

Cheers @kingga I'll add this into the next release.

from php-quill-renderer.

deanblackborough avatar deanblackborough commented on September 13, 2024

Image support in v3.13.0, release in the next day or so.

from php-quill-renderer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.