Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Text Formatter Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Emoji are ideograms and smileys standardized by the Unicode Consortium. The Emoji plugin renders them as images using Twemoji assets. Please consult the Twemoji website for license terms and attribution requirements.

Examples

Using the default set

$configurator = new s9e\TextFormatter\Configurator;
$configurator->Emoji;

// Get an instance of the parser and the renderer
extract($configurator->finalize());

$text = 'Hello world 😀';
$xml  = $parser->parse($text);
$html = $renderer->render($xml);

echo $html;
Hello world <img alt="😀" class="emoji" draggable="false" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f600.svg">

Using JoyPixels

Check out JoyPixels's website for license and attribution requirements.

$configurator = new s9e\TextFormatter\Configurator;

$tag = $configurator->Emoji->getTag();
$tag->template = '<img src="https://cdn.jsdelivr.net/gh/joypixels/emoji-assets@master/png/64/{[@seq](https://github.com/seq)}.png">';

// Get an instance of the parser and the renderer
extract($configurator->finalize());

$text = '😍 JoyPixels';
$xml  = $parser->parse($text);
$html = $renderer->render($xml);

echo $html;
<img src="https://cdn.jsdelivr.net/gh/joypixels/emoji-assets@master/png/64/1f60d.png"> JoyPixels

Inputting emoji as codepoints

In some cases, it may be desirable to input emoji as a sequence of codepoints instead of Unicode characters. Codepoints must be expressed in lowercase hexadecimal and be separated by a single dash. For example: :1f44b-1f3fb:. For compatibility with Twemoji, the fully-qualified sequence using zero-width joiners and variation selectors 16 should be used.

$configurator = new s9e\TextFormatter\Configurator;
$configurator->Emoji;

// Get an instance of the parser and the renderer
extract($configurator->finalize());

$text = 'Hello world :1f937-1f3fe-200d-2640-fe0f:';
$xml  = $parser->parse($text);
$html = $renderer->render($xml);

echo $html;
Hello world <img alt=":1f937-1f3fe-200d-2640-fe0f:" class="emoji" draggable="false" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f937-1f3fe-200d-2640-fe0f.svg">
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours