s9e/text-formatter
PHP text formatting library with plugin support for BBCode, Markdown, HTML, and more. Includes predefined bundles, extensive documentation, and a JavaScript port for client-side preview and demos. Install via Composer and integrate customizable parsing/rendering.
By default, s9e\TextFormatter escapes HTML entities. This plugins allows HTML entities to be used.
Note: while numeric entities such as   are always available, the list of named entities such as ♥ depends on PHP's internal table.
$configurator = new s9e\TextFormatter\Configurator;
$configurator->plugins->load('HTMLEntities');
// Get an instance of the parser and the renderer
extract($configurator->finalize());
$text = 'I ♥ HTML.';
$xml = $parser->parse($text);
$html = $renderer->render($xml);
echo $html;
I ♥ HTML.
How can I help you explore Laravel packages today?