artka54 / ampify
将您的 IMG 标签转换为 Google-Amp 支持的 amp-img
1.0.1
2017-08-21 18:09 UTC
Requires
- php: ~5.6|~7.0
Requires (Dev)
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
This package is not auto-updated.
Last update: 2024-09-29 04:19:48 UTC
README
这是一个将常规 HTML <img> 标签转换为 Google-Amp 要求的 <amp-img> 标签的包。本包已与 ckeditor 进行了测试。
安装
通过 Composer
$ composer require artka54/ampify:1.0.1
使用方法
use artka54\ampify\Ampify as Ampify; $Ampify = new Ampify($htmlToConvert); $Ampified = $Ampify->ampifyImgs();
警告:您的 img 标签必须包含 src、style(表示宽度和高度)和 alt(可以为空)属性。例如,可以使用此包成功转换的正确格式的 img 标签
<img alt="here is the alt" src="http://example.com/blahblah.png" style="height:599px; width:900px">
变更日志
有关最近变更的更多信息,请参阅 CHANGELOG。
安全性
如果您发现任何与安全性相关的问题,请通过电子邮件 artka54@gmail.com 报告,而不是使用问题跟踪器。
致谢
许可证
MIT 许可证(MIT)。有关更多信息,请参阅 许可证文件。