inwebo / markdown-bundle
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/inwebo/markdown-bundle
Requires
- php: ^8.3
- inwebo/markdown: ^1.0
- symfony/framework-bundle: ^7.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.89
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.4
This package is auto-updated.
Last update: 2025-11-10 16:09:02 UTC
README
Introduction
The Inwebo Markdown Bundle integrates Inwebo\Markdown\Factory into Symfony applications, providing a simple and configurable way to convert Markdown to safe HTML. It registers the factory as a service for dependency injection, supports parser configuration and extensions, and is installed via Composer. Inject Inwebo\Markdown\Factory and call parse() to render Markdown content.
See Inwebo\Markdown for more information.
Installation
composer require inwebo/markdown-bundle
Usage
<?php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; use Inwebo\Markdown\Factory; class MarkdownController extends AbstractController { // DI public function __construct(private readonly Factory $factory) { } #[Route('/markdown/preview', name: 'markdown_preview')] public function preview(): Response { $markdown = <<<'MD' # Bonjour Ceci est un exemple de *Markdown* converti en HTML via `Inwebo\Markdown\Factory`. MD; // Call the parser and you are done! $html = $this->factory->parse($markdown); return new Response($html, Response::HTTP_OK, ['Content-Type' => 'text/html; charset=utf-8']); } }