PHPackages                             fluxbb/commonmark - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fluxbb/commonmark

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fluxbb/commonmark
=================

Object-oriented and extensible PHP 5.4+ CommonMark spec-compliant Markdown parser

145711[5 issues](https://github.com/fluxbb/commonmark/issues)5PHP

Since Apr 9Pushed 11y ago3 watchersCompare

[ Source](https://github.com/fluxbb/commonmark)[ Packagist](https://packagist.org/packages/fluxbb/commonmark)[ RSS](/packages/fluxbb-commonmark/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (5)

An extensible CommonMark parser for PHP
=======================================

[](#an-extensible-commonmark-parser-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/5a24f444912f955c75da1e7d39654c1b464ba6d1c2af4e2944468e2a9eced7b6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f666c757862622f636f6d6d6f6e6d61726b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/fluxbb/commonmark/releases)[![Build Status](https://camo.githubusercontent.com/51c986e0caf50b2b6c81204fcc275591c590179ba14d9aeb313286459635de40/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f666c757862622f636f6d6d6f6e6d61726b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/fluxbb/commonmark)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

An object oriented, fully extensible CommonMark parser for PHP 5.4 and above.

[**CommonMark spec**](http://spec.commonmark.org/)

- Forked from [Ciconia](https://github.com/kzykhys/ciconia) by [Kazuyuki Hayashi](https://github.com/kzykhys)
- Tested to comply with the [full CommonMark spec test suite](http://spec.commonmark.org/)

Requirements
------------

[](#requirements)

- PHP 5.4+
- Composer

Installation
------------

[](#installation)

Add the library to your Composer dependencies:

```
composer require fluxbb/commonmark

```

Next, use Composer to install the library and its dependencies:

```
composer install

```

Usage
-----

[](#usage)

### Parsing

[](#parsing)

```
use FluxBB\CommonMark\Parser;

$parser = new Parser();
$html = $parser->render('Markdown is **awesome**');

// Markdown is awesome
```

Rendering
---------

[](#rendering)

The parser renders XHTML by default.

Command Line Interface
----------------------

[](#command-line-interface)

### Usage

[](#usage-1)

Basic usage: (Outputs result to STDOUT)

```
bin/markdown /path/to/file.md

```

The following command saves results to a file:

```
bin/markdown /path/to/file.md > /path/to/file.html

```

Or using pipe (does not work on Windows):

```
echo "Markdown is **awesome**" | bin/markdown

```

### Command Line Options

[](#command-line-options)

```
	--compress (-c)       Remove whitespace between HTML tags
	--lint (-l)           Syntax check only (lint)

```

### Using PHAR version

[](#using-phar-version)

You can also use a [single phar file](https://github.com/fluxbb/commonmark/releases/download/v9.0/markdown.phar)

```
markdown.phar /path/to/file.md

```

If you prefer access this command globally, download [markdown.phar](https://github.com/fluxbb/commonmark/releases/download/v9.0/markdown.phar) and move it into your `PATH`.

```
mv markdown.phar /usr/local/bin/markdown

```

Testing
-------

[](#testing)

Install or update `dev` dependencies.

```
php composer.phar update --dev

```

and run `phpunit`

License
-------

[](#license)

The MIT License

Contributing
------------

[](#contributing)

Feel free to fork this repository and send pull requests. Take a look at [who has contributed so far](https://github.com/fluxbb/commonmark/graphs/contributors).

Author
------

[](#author)

A big thanks to Kazuyuki Hayashi (@kzykhys), who originally created this library.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a8620604a1f4094fee4ab1c3d2f6fccb6583293daf5f866c804d155c05b2e13?d=identicon)[franzliedke](/maintainers/franzliedke)

---

Top Contributors

[![franzliedke](https://avatars.githubusercontent.com/u/249125?v=4)](https://github.com/franzliedke "franzliedke (328 commits)")[![kzykhys](https://avatars.githubusercontent.com/u/1751547?v=4)](https://github.com/kzykhys "kzykhys (153 commits)")[![joelcuevas](https://avatars.githubusercontent.com/u/275014?v=4)](https://github.com/joelcuevas "joelcuevas (2 commits)")[![evert](https://avatars.githubusercontent.com/u/178960?v=4)](https://github.com/evert "evert (1 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (1 commits)")

### Embed Badge

![Health badge](/badges/fluxbb-commonmark/health.svg)

```
[![Health](https://phpackages.com/badges/fluxbb-commonmark/health.svg)](https://phpackages.com/packages/fluxbb-commonmark)
```

###  Alternatives

[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[wcm/git-php-hooks

Write git hooks with PHP, organize them on a per-project base and automatically add them

6441.1k3](/packages/wcm-git-php-hooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
