wpsocio/telegram-format-text

适用于Telegram Bot API的HTML到文本转换器/格式化工具

v1.0.0 2024-01-26 17:06 UTC

This package is auto-updated.

Last update: 2024-09-06 07:26:33 UTC


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