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
$configurator = new s9e\TextFormatter\Configurator;

// Get a list of every card name you want to automatically link
$cards = [
	'Abomination', 'Act of Aggression', 'Armageddon', // etc...
	'Zuran Orb', 'Zuran Spellcaster'
];

foreach ($cards as $card)
{
	// Add the card name as a keyword
	$configurator->Keywords->add($card);

	// BONUS: keywords are case-sensitive but we can add variants of the same
	//        names. Here, we capitalize lowercase words
	if ($card !== ucwords($card))
	{
		$configurator->Keywords->add(ucwords($card));
	}
}

// Define how the names are rendered. Here, as a link to Gatherer
$configurator->Keywords->getTag()->template
	= '<a href="http://gatherer.wizards.com/Pages/Search/Default.aspx?name=+[m/^{[@value](https://github.com/value)}$/]"><xsl:apply-templates/></a>';

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

$text = 'Armageddon and Zuran Orb';
$xml  = $parser->parse($text);
$html = $renderer->render($xml);

echo $html;
<a href="http://gatherer.wizards.com/Pages/Search/Default.aspx?name=+%5Bm/%5EArmageddon$/%5D">Armageddon</a> and <a href="http://gatherer.wizards.com/Pages/Search/Default.aspx?name=+%5Bm/%5EZuran%20Orb$/%5D">Zuran Orb</a>
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.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle