ppito / contentful-html-to-rich-text
Contentful - HTML to Rich Text
Installs: 11 618
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:module
pkg:composer/ppito/contentful-html-to-rich-text
Requires
- php: ^7.3 || ^8.0
- neitanod/forceutf8: ~2.0
This package is auto-updated.
Last update: 2025-10-15 14:40:19 UTC
README
A library to convert basic HTML to Contentful Rich Text.
Installation
Using composer:
composer require ppito/contentful-html-to-rich-text
Usage
Basic
<?php // composer require contentful/contentful-management require __DIR__ . '/vendor/autoload.php'; $content = \Contentful\HtmlToRichText\Tool::parse("<p>Hello</p><p>Another with <strong>bold maybe?</strong></p>");
Supported
The library will convert automatically the following HTML tags :
h1h2h3h4h5h6divpulolliblockquotebrhraspanstrongbuemicodesectionfooterheadernavaside
Unsupported
The attribute HTML are not supported (id="", class="", style="", etc.)