Download the PHP package webfoo/html-to-shopify-rich-text without Composer
On this page you can find all versions of the php package webfoo/html-to-shopify-rich-text. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download webfoo/html-to-shopify-rich-text
More information about webfoo/html-to-shopify-rich-text
Files in webfoo/html-to-shopify-rich-text
Download webfoo/html-to-shopify-rich-text
More information about webfoo/html-to-shopify-rich-text
Files in webfoo/html-to-shopify-rich-text
Vendor webfoo
Package html-to-shopify-rich-text
Short Description A PHP library to convert HTML to Shopify's Rich Text format
License MIT
Package html-to-shopify-rich-text
Short Description A PHP library to convert HTML to Shopify's Rich Text format
License MIT
Please rate this library. Is it a good library?
Informations about the package html-to-shopify-rich-text
HtmlToShopifyRichText
A PHP package that converts HTML content to Shopify's Rich Text format. This package provides a simple and reliable way to transform HTML content into the JSON structure that Shopify's Rich Text editor expects.
Features
- Converts common HTML elements to Shopify Rich Text format
- Supports headings (h1-h6)
- Handles paragraphs, lists (ordered and unordered)
- Processes inline elements (bold, italic, links)
- Sanitizes HTML input
- Validates HTML structure
- Handles whitespace normalization
- Provides detailed error handling
Installation
You can install the package via Composer:
Usage
Supported HTML Elements
- Headings:
<h1>through<h6> - Paragraphs:
<p> - Lists:
<ul>,<ol>,<li> - Links:
<a href="..."> - Bold:
<strong>,<b> - Italic:
<em>,<i>
Error Handling
The package throws specific exceptions for different error scenarios:
InvalidHtmlException: Thrown when the HTML is invalid or cannot be parsedConversionException: Thrown when the conversion process failsJsonEncodingException: Thrown when the JSON encoding fails
Example error handling:
Requirements
- PHP 8.1 or higher
- Composer
- Required dependencies:
symfony/dom-crawlerezyang/htmlpurifier
License
This package is open-sourced software licensed under the MIT license.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
All versions of html-to-shopify-rich-text with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.3
ext-dom Version *
ext-json Version *
ext-mbstring Version *
symfony/dom-crawler Version ^7.2
symfony/css-selector Version ^7.2
ezyang/htmlpurifier Version ^4.16
ext-dom Version *
ext-json Version *
ext-mbstring Version *
symfony/dom-crawler Version ^7.2
symfony/css-selector Version ^7.2
ezyang/htmlpurifier Version ^4.16
The package webfoo/html-to-shopify-rich-text contains the following files
Loading the files please wait ...