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

From posting to displaying to editing, s9e\TextFormatter separates its operations in 4 distinct phases:

  • Configuration: configure s9e\TextFormatter and the plugins you want to use, or use a preconfigured bundle.

  • Parsing: the text is parsed and can be stored as an XML document.

  • Rendering: the XML document is transformed into HTML.

  • Unparsing: the XML document is transformed back into plain text.

                Parsing 
              ↗         ↘
Original text             XML → Rendering → HTML
              ↖         ↙
               Unparsing

The configurator object can be used to generate a parser object and a renderer object. They can be serialized and should be cached for performance. Preconfigured parsers and renderers are available through bundles.

                             $parser
                           ↗    ↕
$configurator → finalize()   (cache)
                           ↘    ↕
                             $renderer

The parser object transforms plain text into XML, the renderer object transforms XML into HTML. The XML can be reverted back to the original text using the s9e\TextFormatter\Unparser::unparse() static method. This is done without losing or modifying any content. (apart from a few control characters such as NUL bytes)

        $parser->parse()
      ↗                  ↘
$text                      $xml → $renderer->render() → $html
      ↖                  ↙
       Unparser::unparse()
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