Skip to content

wpsocio/telegram-format-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPSocio\TelegramFormatText

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