PHPackages                             everyday/html-to-quill - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. everyday/html-to-quill

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

everyday/html-to-quill
======================

PHP HTML to Quill Delta converter

0.4.0(4y ago)731.1k↑697.6%5[3 issues](https://github.com/everyday-as/html-to-quill/issues)[1 PRs](https://github.com/everyday-as/html-to-quill/pulls)1Apache-2.0PHPPHP &gt;=8.0

Since May 17Pushed 3y ago3 watchersCompare

[ Source](https://github.com/everyday-as/html-to-quill)[ Packagist](https://packagist.org/packages/everyday/html-to-quill)[ Docs](https://github.com/Everyday-AS/html-to-quill)[ RSS](/packages/everyday-html-to-quill/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (1)

html-to-quill
=============

[](#html-to-quill)

html-to-quill is a PHP library for converting an HTML string to Quill deltas.

Installation
------------

[](#installation)

html-to-quill can be installed through Composer.

```
$ composer require everyday/html-to-quill
```

Basic Usage
-----------

[](#basic-usage)

The `HtmlConverter` class provides a simple interface for converting from HTML to Quill Deltas:

```
use Everyday\HtmlToQuill\HtmlConverter;

$converter = new HtmlConverter();
echo json_encode($converter->convert("Hello World!"));

// {"ops":[{"insert":"Hello World!"},{"insert":"\n","attributes":{"header":1}}]}
```

Supporting Custom Tag Behaviour
-------------------------------

[](#supporting-custom-tag-behaviour)

Custom tags can be supported through customer converters. Converters take a DOMNode as an input, and return a DeltaOp. The default converters can be found in src/Converters

Custom converters can be implemented to handle additional behaviour, which are then implemented into an extension of the HtmlConverter.

### Example: Parsing &lt;style&gt; tags as code blocks.

[](#example-parsing-style-tags-as-code-blocks)

To enable parsing style tags, two converters are required. One for the &lt;style&gt; tag itself, and one for the #cdata-section which represents the internal data.

For this example, namespaces will be omitted.

```
class StyleConverter extends CodeConverter {
	public function getSupportedTags(): array {
		return ['style'];
	}
}
```

```
class CDataConverter extends TextConverter {
	public function getSupportedTags(): array {
		return ['#cdata-section'];
	}
}
```

```
class StyleCodeBlockEnabledHtmlConverter extends HtmlConverter {
	public function __construct(){
		parent::__construct(); // We want our default converters.
		$this->converters[] = new StyleConverter();
		$this->converters[] = new CDataConverter();
	}
}
```

These classes combine in the same style as the basic usage example, to produce our usable output:

```
$converter = new StyleCodeBlockEnabledHtmlConverter();
echo json_encode($converter->convert(".warning {background-color: red;}"));

// {"ops":[{"insert":".warning {background-color: red;}","attributes":{"code":true}},{"insert":"\n"}]}
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~161 days

Total

5

Last Release

1626d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b1a9a39f540b62d115b157a36eb3ebeb32274e5f287df35a4a19e873bf09385?d=identicon)[J0sh0nat0r](/maintainers/J0sh0nat0r)

---

Top Contributors

[![Marcuzz](https://avatars.githubusercontent.com/u/3168421?v=4)](https://github.com/Marcuzz "Marcuzz (8 commits)")[![JoshPiper](https://avatars.githubusercontent.com/u/32164094?v=4)](https://github.com/JoshPiper "JoshPiper (6 commits)")[![J0sh0nat0r](https://avatars.githubusercontent.com/u/16763483?v=4)](https://github.com/J0sh0nat0r "J0sh0nat0r (3 commits)")[![stepanorda](https://avatars.githubusercontent.com/u/6368917?v=4)](https://github.com/stepanorda "stepanorda (2 commits)")

---

Tags

converthtmldeltaquill

### Embed Badge

![Health badge](/badges/everyday-html-to-quill/health.svg)

```
[![Health](https://phpackages.com/badges/everyday-html-to-quill/health.svg)](https://phpackages.com/packages/everyday-html-to-quill)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.3k](/packages/craftcms-cms)[spatie/laravel-export

Create a static site bundle from a Laravel app

679153.2k7](/packages/spatie-laravel-export)[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3374.1M35](/packages/wa72-htmlpagedom)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49617.1k](/packages/blackfire-player)[nadar/quill-delta-parser

A PHP library to parse Quill WYSIWYG editor deltas into HTML - flexible and extendible for custom elements.

130881.2k6](/packages/nadar-quill-delta-parser)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2023.2M364](/packages/drupal-core-dev)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
