dflydev/markdown
最新稳定版本:v1.0.3
Composer 安装命令:
composer require dflydev/markdown
包简介
PHP Markdown & Extra - DEPRECATED
关键字:
README 文档
README
An updated and stripped version of the original PHP Markdown by Michel Fortin. Works quite well with PSR-0 autoloaders and is Composer friendly.
This Project Has Been Deprecated
Thank you for your interest in contributing to this package. Unfortunately, I do not plan to continue maintaining this package.
The original purpose of this package was to provide a way to get a PSR-0 and Composer friendly port of Michel Fortin's PHP Markdown library on Packagist. Michel was originally uninterested in Composer and did not want to make changes and said I was free to fork and maintain a special Composer package.
In January of 2013 (or around then) Michel finally joined the Composer bandwagon. More details can be found here. This means that the major reason this port existed (to be a Composer friendly port) effectively went away. This corresponded with the 1.3 release of PHP Markdown.
Additionally, other versions of PHP Markdown parsers have come into existence and are quite nice.
Please feel free to continue to use it as-is but if you are starting a new project I would recommend finding another library. If you have a project already depending on this package, I would recommend planning to migrate to something that is better maintained.
Thanks for your support and using this library over the years.
Changes from the official PHP Markdown & Extra
The initial pass at updating PHP Markdown & Extra left the core of the code more or less intact but the changes to the organization and naming were quite substantial. This effectively makes this package a hard fork from Markdown 1.0.1n and MarkdownExtra 1.2.4.
Updated in the following ways:
- Moved parser classes into their own files
- Using PHP 5.3 namespaces
- Following PSR-0 standards
- Replaced
@defineconfiguration variables with classconstvariables - Integrated with Travis CI
- Made Composer friendly
Stripped in the following ways:
- No more embedded plugin code (WordPress, bBlog, etc.)
- No more top level function calls (
Markdown(), etc.)
Last synced with:
- PHP Markdown v1.0.1o
- PHP Markdown Extra v1.2.5
Requirements
- PHP 5.3+
Installation
To add this package as a local, per-project dependency to your project, simply add a
dependency on dflydev/markdown to your project's composer.json file.
Here is a minimal example of a composer.json file that just defines a dependency on
version 1.0 of this package:
{
"require": {
"dflydev/markdown": "1.0.*"
}
}
Usage
Simple usage for the standard Markdown (details) parser:
<?php
use dflydev\markdown\MarkdownParser;
$markdownParser = new MarkdownParser();
// Will return <h1>Hello World</h1>
$markdownParser->transformMarkdown("#Hello World");
Simple usage for the Markdown Extra (details) parser:
<?php
use dflydev\markdown\MarkdownExtraParser;
$markdownParser = new MarkdownExtraParser();
// Will return <h1>Hello World</h1>
$markdownParser->transformMarkdown("#Hello World");
License
This library is licensed under the New BSD License - see the LICENSE file for details.
Community
If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.
Not Invented Here
The original PHP Markdown was quite excellent but was not as easy to use as it could be in more modern PHP applications. Having started to use Composer for a few newer applications that needed to transform Markdown, I decided to strip and update the original PHP Markdown so that it could be more easily managed by the likes of Composer.
All of the initial work done for this library (which I can only assume was quite substantial after having looked at the code) was done by Michel Fortin during the original port from Perl to PHP.
If you do not need to install PHP Markdown by way of Composer or need to leverage PSR-0 autoloading, I suggest you continue to use the official and likely more stable and well used original version of PHP Markdown
dflydev/markdown 适用场景与选型建议
dflydev/markdown 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.72M 次下载、GitHub Stars 达 173, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「markdown」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dflydev/markdown 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dflydev/markdown 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dflydev/markdown 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated again
Adds more BBCode
Creates a markdown changelog for your GitHub repository.
Lightweight Application To Convert WordPress Readme Into Github Markdown
The Attogram Framework provides developers a PHP skeleton starter site with a content module system, file-based URL routing, IP-protected backend, Markdown parser, jQuery and Bootstrap. Core modules available to add an integrated SQLite database with web admin, user system, and more.
Parser for Markdown.
统计信息
- 总下载量: 5.72M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 188
- 点击次数: 26
- 依赖项目数: 45
- 推荐数: 8
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2026-01-04