wpsocio / telegram-format-text
HTML to Text converter/formatter for Telegram Bot API
Installs: 144
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/wpsocio/telegram-format-text
Requires (Dev)
- pestphp/pest: ^1.23
- wp-coding-standards/wpcs: ^3.1
README
HTML to Text converter/formatter for Telegram Bot API
Inspired by thephpleague/html-to-markdown.
Usage
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 );
Requirements
PHP >= 8.0