ppito / contentful-html-to-rich-text
Contentful - HTML 到富文本
1.0.5
2022-10-15 08:05 UTC
Requires
- php: ^7.3 || ^8.0
- neitanod/forceutf8: ~2.0
This package is auto-updated.
Last update: 2024-09-15 12:23:30 UTC
README
一个用于将基本 HTML 转换为 Contentful 富文本的库。
安装
使用 Composer
composer require ppito/contentful-html-to-rich-text
使用方法
基本
<?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>");
支持的
该库将自动转换以下 HTML 标签
h1h2h3h4h5h6divpulolliblockquotebrhraspanstrongbuemicodesectionfooterheadernavaside
不支持的
HTML 属性不支持(如 id="",class="",style="" 等)