wpsocio / telegram-format-text
适用于Telegram Bot API的HTML到文本转换器/格式化工具
v1.0.0
2024-01-26 17:06 UTC
Requires (Dev)
- pestphp/pest: ^1.22
- wp-coding-standards/wpcs: ^3.0.1
README
适用于 Telegram Bot API 的HTML到文本转换器/格式化工具
灵感来源于 thephpleague/html-to-markdown.
使用方法
composer require wpsocio/telegram-format-text
require_once __DIR__ . '/autoload.php'; $html = 'Some html here'; $options = [ 'format_to' => 'Markdown', ]; $converter = new \WPSocio\TelegramFormatText\HtmlConverter( $options ); // The text is now safe to be sent to Telegram $text = $converter->convert( $html );
要求
PHP >= 8.0