zmr-robin/php-markdown 问题修复 & 功能扩展

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

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

zmr-robin/php-markdown

最新稳定版本:v0.1.3

Composer 安装命令:

composer require zmr-robin/php-markdown

包简介

PHPMarkdown is a simple PHP class that converts Markdown syntax into HTML.

README 文档

README

Lightweight PHP Markdown to HTML Parser

PHPMarkdown is a simple yet powerful PHP class that converts Markdown syntax into HTML.

Features

  • Converts Markdown headers
  • Supports bold, italic, underline, strikethrough, and ==highlight==
  • Handles unordered and numbered lists
  • Converts blockquotes
  • Converts hyperlinks
  • Converts images
  • Maintains nested lists and mixed content formatting
  • Easy to extend with additional Markdown syntax

Installation

1. Install package using composer

composer require zmr-robin/php-markdown

2. Include the class in your project

require_once 'vendor/autoload.php';
$parser = new PHPMarkdown();

2. Convert a Markdown file to HTML

$file = file('example.md');
$html = $parser->convertFileToHtml($file);
echo $html;

3. Or convert a single line

$htmlLine = $parser->convertLineToHtml("**Bold text** and *italic*");
echo $htmlLine; 
// Outputs: <b>Bold text</b> and <i>italic</i>

Example

Markdown Input

# Header 1
* Item 1
* Item 2
> Quote example
**Bold text** and *italic text* [Google](https://www.google.com)

HTML Output

<h1>Header 1</h1>
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
<blockquote>Quote example</blockquote>
<b>Bold text</b> and <i>italic text</i> <a href='https://www.google.com'>Google</a>

Try it for yourself

Visit the live demo.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固