inwebo/markdown-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inwebo/markdown-bundle

最新稳定版本:1.0.0

Composer 安装命令:

composer require inwebo/markdown-bundle

包简介

README 文档

README

Packagist Version Packagist Downloads Packagist License

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']);
    }
}

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2025-11-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固