fluxbb/commonmark
Laravel-friendly CommonMark utilities from FluxBB: parse, render, and work with Markdown/CommonMark content in PHP with sensible defaults and integration patterns suited to Laravel apps. Lightweight package aimed at consistent, safe content rendering.
fluxbb/commonmark package provides a CommonMark-compliant Markdown parser in PHP, making it ideal for applications requiring structured text processing (e.g., documentation, forums, CMS, or collaborative tools). It aligns well with Laravel’s ecosystem, particularly for:
parsedown/parsedown: Object-oriented, extensible, and CommonMark-compliant (vs. legacy Markdown).spatie/laravel-markdown: Lacks Laravel-specific helpers (e.g., caching, Blade directives), requiring manual integration.symfony/event-dispatcher is widely used).Purifier or similar).parsedown if issues arise).spatie/laravel-markdown)?composer require fluxbb/commonmark.$this->app->singleton(ParserInterface::class, function ($app) {
return new Parser();
});
Blade::directive('markdown', function ($expression) {
return "<?php echo app('fluxbb\\CommonMark\\Parser')->parse({$expression}); ?>";
});
FormRequest to parse Markdown input before storage.parsedown).Illuminate\Support\Facades\Cache).fluxbb/commonmark for CommonMark spec updates (e.g., v0.31 → v0.32).symfony/event-dispatcher) via composer update.Purifier).Parser::parse($markdown, Parser::DEFAULT_PROCESSOR).Xdebug or Blackfire.Log facade to track parsing failures.laravel-queue) to offload from web servers.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Parser crashes | Broken rendering, 500 errors | Fallback to parsedown, retry queue |
| Malformed Markdown | Corrupted output, XSS | Input validation, Purifier |
| Cache stampede | High |
How can I help you explore Laravel packages today?