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

Fatdown is a bundle based on the Litedown plugin which supports most of Markdown's features, plus the MediaEmbed and FancyPants plugins for media embedding and enhanced typography.

Demo

You can try the real-time JavaScript demo, or you can compare Fatdown to various Markdown implementations via the wonderful Babelmark 2.

Examples

use s9e\TextFormatter\Bundles\Fatdown as TextFormatter;

$text = '**Fatdown** implements a Markdown-like syntax plus extra Stuff(tm).';
$xml  = TextFormatter::parse($text);
$html = TextFormatter::render($xml);

echo $html;
<p><strong>Fatdown</strong> implements a Markdown-like syntax plus extra Stuff™.</p>

Why Fatdown doesn't suck

Unlike the original Markdown specification and most Markdown flavours, Fatdown's HTML support does not allow JavaScript to be executed and is suitable for untrusted input.

use s9e\TextFormatter\Bundles\Fatdown as TextFormatter;

$text = '<img src="http://127.0.0.1/fake.png" onerror="alert(1)"/>';
$xml  = TextFormatter::parse($text);
$html = TextFormatter::render($xml);

echo $html;
<p><img src="http://127.0.0.1/fake.png"></p>

Plugins

  • Autoemail
  • Autolink
  • Escaper
  • FancyPants
  • HTMLComments
  • HTMLElements
  • HTMLEntities
  • Litedown
  • MediaEmbed
  • PipeTables
  • TaskLists

HTMLElements

  • a with a mandatory href attribute and an optional title attributes
  • abbr with an optional title attribute
  • b, em, i, s, strong, u
  • br
  • code
  • dl, dt and dd
  • del and ins
  • div with an optional class attribute
  • hr
  • img with a mandatory src attribute and optional alt and title attributes
  • rb, rp, rt and rtc for all your ruby needs
  • span with an optional class attribute
  • sub and sup
  • table, tbody, tfoot, thead
  • td with optional colspan and rowspan attributes
  • th with optional colspan, rowspan and scope attributes

MediaEmbed

URLs from the following sites are automatically embedded: Bandcamp, Dailymotion, Facebook, Liveleak, Soundcloud, Spotify, Twitch, Vimeo, Vine and YouTube.

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