hyw97m / parsedown

Parser for Markdown in PHP

Home Page:parsedown.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsedown

Better Markdown parser for PHP.

Features

Installation

Include Parsedown.php or install the composer package.

Example

$Parsedown = new Parsedown();

echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>

More examples in the wiki.

Api Doc Example

weibo openapi.

Questions

How does Parsedown work?
Parsedown recognises that the Markdown syntax is optimised for humans so it tries to read like one. It goes through text line by line. It looks at how lines start to identify blocks. It looks for special characters to identify inline elements.

Why doesn’t Parsedown use namespaces?
Using namespaces would mean dropping support for PHP 5.2. Since Parsedown is a single class with an uncommon name, making this trade wouldn't make much sense.

Who uses Parsedown?
phpDocumentor, Bolt CMS, RaspberryPi.org and more.

About

Parser for Markdown in PHP

parsedown.org

License:MIT License