s9e/text-formatter

Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding third-party media (YouTube, etc...), enhanced typography and more.

Maintainers

👁 s9e

Package info

github.com/s9e/TextFormatter

Homepage

pkg:composer/s9e/text-formatter

Statistics

Installs: 3 301 527

Dependents: 26

Suggesters: 0

Stars: 242

Open Issues: 6

2.19.3 2025-11-14 21:26 UTC

Requires

Suggests

  • ext-curl: Improves the performance of the MediaEmbed plugin and some JavaScript minifiers
  • ext-intl: Allows international URLs to be accepted by the URL filter
  • ext-json: Enables the generation of a JavaScript parser
  • ext-mbstring: Improves the performance of the PHP renderer
  • ext-tokenizer: Improves the performance of the PHP renderer
  • ext-xsl: Enables the XSLT renderer
  • ext-zlib: Enables gzip compression when scraping content via the MediaEmbed plugin

Provides

None

Conflicts

None

Replaces

None

This package is auto-updated.

Last update: 2026-05-25 19:56:17 UTC


README

s9e\TextFormatter is a text formatting library that supports BBCode, Markdown, HTML and other markup via plugins. The library is written in PHP, with a JavaScript port also available for client-side preview (see below.)

👁 Packagist Version
👁 Scrutinizer Quality Score
👁 Code Coverage
👁 Documentation

Installation

The best way to install s9e\TextFormatter is via Composer. See Installation.

composer require s9e/text-formatter

Examples

If you can only read one example, read how to use a bundle.

You can run the scripts directly from the examples directory and you will find in the manual a description of each plugin as well as other examples.

Versioning

Versioning is meant to follow Semantic Versioning. You can read about API changes in the documentation.

Online demo

You can try the JavaScript version in this BBCodes + other stuff demo, or this Markdown + stuff (Fatdown) demo.

Development tools

The following tools are used during development.