PHPackages                             picas/markdown-extended - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. picas/markdown-extended

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

picas/markdown-extended
=======================

Yet another PHP parser for the markdown (\*extended\*) syntax

v1.0.0-rc.12(2y ago)392.7k3BSD-3-ClausePHP &gt;=5.6

Since Oct 21Compare

[ Source](https://github.com/e-picas/markdown-extended)[ Packagist](https://packagist.org/packages/picas/markdown-extended)[ Docs](http://github.com/e-picas/markdown-extended)[ RSS](/packages/picas-markdown-extended/feed)WikiDiscussions Synced today

READMEChangelog (10)Dependencies (7)Versions (24)Used By (3)

PHP Markdown Extended
=====================

[](#php-markdown-extended)

Yet another PHP parser for the markdown (*extended*) syntax.

[![Community](https://camo.githubusercontent.com/a2e411c482b63660649fdaa3ae3b058a0c5a0c9dc93a591245192e0cd45fe932/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4a6f696e253230746865253230636f6d6d756e6974792d6f6e25323047697448756225323044697363757373696f6e732d626c7565)](https://github.com/e-picas/markdown-extended/discussions)[![License](https://camo.githubusercontent.com/46397d2f7aa5c97e6072d0a1462591526a3dff3b182afd49860d9082be3d8c74/687474703a2f2f706f7365722e707567782e6f72672f70696361732f6d61726b646f776e2d657874656e6465642f6c6963656e7365)](https://packagist.org/packages/picas/markdown-extended)[![PHP Version Require](https://camo.githubusercontent.com/235f5b0371167f0ba8764ac515cd26579a0ad073be7696b5c642993985deee22/687474703a2f2f706f7365722e707567782e6f72672f70696361732f6d61726b646f776e2d657874656e6465642f726571756972652f706870)](https://packagist.org/packages/picas/markdown-extended)[![Version](https://camo.githubusercontent.com/98e76f5f3a6e127650673c752fb23c7e93c16379976d99a6d80915fc7b508450/687474703a2f2f706f7365722e707567782e6f72672f70696361732f6d61726b646f776e2d657874656e6465642f76657273696f6e)](https://packagist.org/packages/picas/markdown-extended)[![Last Release](https://camo.githubusercontent.com/833d7561b9fbe51eac7bd74030cc9e4f5a211ce2b20114ca0e9b1e3754700a97/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f652d70696361732f6d61726b646f776e2d657874656e6465643f736f72743d73656d766572266c6162656c3d6c61737425323072656c65617365)](https://github.com/e-picas/markdown-extended/releases)[![Code Climate](https://camo.githubusercontent.com/2865f81db43bd0d6b783960bb0b78dc236cb93c076bc165eb759a4dc1196d1cb/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f652d70696361732f6d61726b646f776e2d657874656e6465642f6261646765732f6770612e737667)](http://codeclimate.com/github/e-picas/markdown-extended)[![Test Coverage](https://camo.githubusercontent.com/c20f037d1927345577469d4f6a38c0d7fa61e75055ccce57cd9bd7c7a56f3471/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33303337343565363631646235616433373165662f746573745f636f766572616765)](https://codeclimate.com/github/e-picas/markdown-extended/test_coverage)

[![Tests status PHP7](https://github.com/e-picas/markdown-extended/actions/workflows/test_php7.yml/badge.svg?branch=develop-php7)](https://github.com/e-picas/markdown-extended/actions/workflows/test_php7.yml)[![Tests status PHP8](https://github.com/e-picas/markdown-extended/actions/workflows/test_php8.yml/badge.svg?branch=develop-php7)](https://github.com/e-picas/markdown-extended/actions/workflows/test_php8.yml)[![Tests status PHP5](https://github.com/e-picas/markdown-extended/actions/workflows/test_php5.yml/badge.svg?branch=develop-php7)](https://github.com/e-picas/markdown-extended/actions/workflows/test_php5.yml)

[![PHP](https://camo.githubusercontent.com/d49fb3a39eb94594ef541db44bef1350ed52298eee75756cf9b4d2baef5adedf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3525324637253246382d6531303037393f6c6f676f3d706870)](https://www.php.net/)[![Composer](https://camo.githubusercontent.com/013bf98b76614c927a432ce2603445d8156b80c48f11a6e9443042ddba2801e1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d677265793f6c6f676f3d636f6d706f736572)](https://getcomposer.org/)[![Git Flow](https://camo.githubusercontent.com/b9e2da933d65c6564622f7c6a8438373cf75b4b3509bc8c83f4aa82d952ce520/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476974466c6f772d677265793f6c6f676f3d676974)](https://git-flow.readthedocs.io/en/latest/presentation.html)[![Semantic Release](https://camo.githubusercontent.com/715e0ae2610264bdc3e4f0a9c1cde5f22e75351d6a441b9fd047b91ea366d7c1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53656d616e7469635f52656c656173652d616e67756c61722d6531303037393f6c6f676f3d73656d616e7469632d72656c65617365)](https://semantic-release.gitbook.io/semantic-release/)[![Docker](https://camo.githubusercontent.com/90cd75726d8b9d4c683c950443265691a2648b9480c0b88772ccd8bde7b9c7d5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f636b65722d677265793f6c6f676f3d646f636b6572)](https://www.docker.com/)[![GitHub actions](https://camo.githubusercontent.com/00a57647a7d87744beea32ef46dfd7f76380704470c706ae05b46f52bfd5dad2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769746875625f416374696f6e732d677265793f6c6f676f3d676974687562)](https://github.com/features/actions)[![Conventional commits](https://camo.githubusercontent.com/d94fa121dc56bb3e4fc15d3be28e755c664ddd5a8eb8da43c1549ad7ce4799c4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6e76656e74696f6e616c5f436f6d6d6974732d677265793f6c6f676f3d636f6e76656e74696f6e616c636f6d6d697473)](https://www.conventionalcommits.org/en/v1.0.0/)

[![PHP Unit](https://camo.githubusercontent.com/aebd32d3012d2e1b081632c83e7ed0579055034a51d72d92ed008cb575467f02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374696e672d5048505f556e69742d677265793f7374796c653d736f6369616c266c6f676f3d7061636b6167697374)](https://phpunit.de/)[![PHP CS Fixer](https://camo.githubusercontent.com/8995bb728fb92d451115d5718f1ded26586dd4b1c202e9f81a6b6ee878a2976b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7175616c6974792d5048505f43535f46697865722d677265793f7374796c653d736f6369616c266c6f676f3d7061636b6167697374)](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)[![PHP Mess Detector](https://camo.githubusercontent.com/d5dd04f8bc470118460e698344b70f5e914d68b3ccbe70584e7408b7c9095625/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7175616c6974792d5048505f4d6573735f4465746563746f722d677265793f7374796c653d736f6369616c266c6f676f3d7061636b6167697374)](https://phpmd.org/)[![PHP Metrics](https://camo.githubusercontent.com/17f234bdc5aafe8c7611a389c4ea94712b9b1c26b109179c80f78bf26eeaf962/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7175616c6974792d5048505f4d6574726963732d677265793f7374796c653d736f6369616c266c6f676f3d7061636b6167697374)](https://phpmetrics.org/)[![PHP Doc](https://camo.githubusercontent.com/5a1402258784eec4673146957246b24e9a2bea58b70b4803707494237d04681b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f632d5048505f446f632d677265793f7374796c653d736f6369616c266c6f676f3d7061636b6167697374)](https://docs.phpdoc.org/)

---

**PHP Markdown Extended** is a PHP parser to transform [Markdown](http://en.wikipedia.org/wiki/Markdown)text files or strings in HTML or other formats. This new version of a Markdown parser tries to follow the [extended syntax specifications](http://manifest.aboutmde.org/) and is PHP-5.3 compliant and highly customizable.

You can use this package in PHP scripts just as usual (for PHP apps) and also like a standalone command line utility. The CLI interface is interactive with a large set of options and fully documented.

**README contents:**

- [Installation](#installation)
    - [Raw PHP package](#raw-php-package)
    - [Using Composer](#using-composer)
    - [Using a standalone version](#using-a-standalone-version)
        - [Locally](#locally)
        - [Personally](#personally)
        - [Globally](#globally)
- [Usage](#usage)
    - [Usage for writers](#usage-for-writers)
    - [Usage for developers](#usage-for-developers)
    - [Command line usage](#command-line-usage)
    - [Old parsers compatibility](#old-parsers-compatibility)
- [Open-Source &amp; Community](#open-source--community)
- [License](#license)

---

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

[](#installation)

You can use this package in your work in many ways. Please note that it requires a running [PHP](http://php.net/) version of 5.3.3 minimum.

### Raw PHP package

[](#raw-php-package)

First, you can clone the [GitHub](http://github.com/e-picas/markdown-extended)repository and include it "as is" in your project:

```
$ git clone https://github.com/e-picas/markdown-extended.git
```

You can also download an [archive](http://github.com/e-picas/markdown-extended/downloads)from GitHub:

```
$ wget --no-check-certificate https://github.com/e-picas/markdown-extended/archive/master.tar.gz
$ tar -xvf master.tar.gz
```

Then, to use the package classes, you just need to include its *bootstrapper* which will register its namespaces in current runtime environment:

```
require_once 'path/to/package/src/bootstrap.php';
```

### Using Composer

[](#using-composer)

Another way to use the package, if you are a [Composer](http://getcomposer.org/) user, is to add it to your requirements in your `composer.json` file:

```
"picas/markdown-extended": "dev-master"
```

The namespace will be automatically added to the project's Composer's *autoloader*.

### Using a standalone version

[](#using-a-standalone-version)

Finally, if you plan to use the parser as a single binary, you can use a [PHAR archive](http://php.net/manual/en/book.phar.php) directly, which embeds the whole source as a standalone binary (~220Kb). Its usage is the same as the `bin/markdown-extended` script [described below](#command-line-usage).

The archive is stored in a specific `phar-latest` branch on the repository:

```
$ wget --no-check-certificate https://github.com/e-picas/markdown-extended/archive/phar-latest.tar.gz
$ tar -xvf phar-latest.tar.gz
$ cd phar-latest
```

#### Locally

[](#locally)

If you only need the archive for a local project, you can copy it where you want:

```
$ cp bin/markdown-extended.phar your/project/path/
$ php your/project/path/markdown-extended.phar ...
```

#### Personally

[](#personally)

To install the binary in your user's binaries:

```
$ ./install.sh ~/bin false
```

#### Globally

[](#globally)

For a complete global install, run:

```
$ sudo ./install.sh /usr/local
```

Usage
-----

[](#usage)

An HTML demonstration and the code documentation are available on the "dev" branch.

### Usage for writers

[](#usage-for-writers)

To be compliant with the **extended** Markdown syntax, writers may construct their contents following the rules described at  (all basic markdown rules are still available and valid).

For a full example and a test file, you can refer to the `demo/MD_syntax.md` file of the package ; the latest version can be found at [http://github.com/e-picas/markdown-extended/blob/dev/demo/MD\_syntax.md](http://github.com/e-picas/markdown-extended/blob/dev/demo/MD_syntax.md).

### Usage for developers

[](#usage-for-developers)

The source code documentation of the last stable release can also be found online at .

The `MarkdownExtended` package can be simply call writing:

```
use \MarkdownExtended\MarkdownExtended;     // load the namespace

$options = array( /* ... */ );              // parser options, see documentation

// parse a string or a file content
$content = MarkdownExtended::parse( "my markdown string" OR 'my-markdown-file.md' , $options );

// parse a string
$content = MarkdownExtended::parseString( "my markdown string" , $options );

// parse a file content
$content = MarkdownExtended::parseSource( 'my-markdown-file.md' , $options );
```

This will load in `$content` the parsed version of your original Markdown source (file content or string).

The returned `$content` variable is actually a `\MarkdownExtended\API\ContentInterface`object but you can write it directly using:

```
echo $content;          // shortcut for $content->getContent()
```

To get the part you need from the content, write:

```
$content
    ->getContent()      // the full content
    ->getCharset()      // a guessed character set
    ->getTitle()        // the guessed title
    ->getBody()         // the body
    ->getMetadata()     // the metadata as array
    ->getNotes()        // the notes as array
;
```

You can also use the `\MarkdownExtended\Parser` object as a procedural non-static object (this is in fact what the static methods above really do):

```
// create an instance with custom options
$parser = new \MarkdownExtended\Parser( $options );

// parse a string
$content = $parser->transform( "my markdown string" );

// parse a file content
$content = $parser->transformSource( 'my-markdown-file.md' );
```

A more complete usage documentation is available in the package's documents (`doc/DOCUMENTATION.md`). You can read it online at . Its *manpage* version is embedded in the package running:

```
$ man ./man/markdown-extended.7.man
```

### Command line usage

[](#command-line-usage)

A command line interface is proposed with the package running:

```
$ ./bin/markdown-extended --help
```

The interface allows to parse one or more files, extract some information from sources, write the results in files and some other stuff. A large set of options are available to customize the transformation.

A complete *manpage* is available in the package's `man/` directory and its markdown source is available in its documents (`doc/MANPAGE.md`). To read it, run:

```
$ man ./man/markdown-extended.3.man
```

The developer documentation is also available as a *manpage* running:

```
$ man ./man/markdown-extended.7.man
```

**Examples of cli usage:**

```
# transform a simple string
$ ./bin/markdown-extended "my **markdown** _extended_ string"
my markdown extended string

# transform a file content with output to STDOUT
$ ./bin/markdown-extended my-markdown-file.md
...

# transform a file content with output in file
$ ./bin/markdown-extended --output=my-transformed-markdown.html my-markdown-file.md
...

# generate the manpage itslef
$ ./bin/markdown-extended -f man -o man/markdown-extended.man doc/MANPAGE.md
...
```

### Old parsers compatibility

[](#old-parsers-compatibility)

To keep the package compatible with old versions of Markdown, an interface is embedded with the common `Markdown($content)` function ; to use it, just include the file `src/markdown.php` of the package:

```
require_once 'path/to/src/markdown.php';

// to get result of a string parsing:
echo Markdown($string [, $options]);

// to get result of a file content parsing:
echo MarkdownFromSource($file_name [, $options]);
```

This way, you may be able to change your Markdown parser without so much work and, I hope so, a better result ;)

Open-Source &amp; Community
---------------------------

[](#open-source--community)

This parser is a free software, available under [BSD license](http://en.wikipedia.org/wiki/BSD_licenses) ; you can freely use it, for yourself or a commercial use, modify its source code according to your needs, freely distribute your work and propose it to the community, as long as you let an information about its first authors.

As the sources are hosted on a [GIT](http://git-scm.com/) repository on [GitHub](http://github.com/e-picas/markdown-extended), you can modify it, to ameliorate a feature or correct an error. Please read the [`CONTRIBUTING.md`file of the package](https://github.com/e-picas/markdown-extended/blob/master/CONTRIBUTING.md)for more info.

License
-------

[](#license)

This software, as the original Markdown, is licensed under the terms of the [BSD-3-Clause license](http://opensource.org/licenses/BSD-3-Clause). Please see the `LICENSE` file for a full text.

You can use, transform and distribute this software and its dependencies as you wish, as long as you mention the copyrights below:

```
Markdown
Copyright (c) 2003-2006 John Gruber

All rights reserved.

PHP Markdown & Extra
Copyright (c) 2004-2009 Michel Fortin

All rights reserved.

Multi Markdown
Copyright (c) 2005-2009 Fletcher T. Penney

All rights reserved.

PHP Markdown Extended
Copyright (c) 2008-2024 Pierre Cassat & contributors

All rights reserved.

```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Every ~290 days

Recently: every ~2 days

Total

14

Last Release

872d ago

Major Versions

v0.1.0-beta → v1.0.0-rc.12024-02-04

PHP version history (2 changes)v0.1.0-alphaPHP &gt;=5.3.0

v1.0.0-rc.1PHP &gt;=5.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/295156?v=4)[JustCrazy](/maintainers/picas)[@PICAS](https://github.com/PICAS)

---

Tags

markdownmarkdown extendedmde

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/picas-markdown-extended/health.svg)

```
[![Health](https://phpackages.com/badges/picas-markdown-extended/health.svg)](https://phpackages.com/packages/picas-markdown-extended)
```

###  Alternatives

[erusev/parsedown

Parser for Markdown.

15.1k156.8M870](/packages/erusev-parsedown)[league/commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)

3.0k437.5M1.0k](/packages/league-commonmark)[michelf/php-markdown

PHP Markdown

3.5k54.5M379](/packages/michelf-php-markdown)[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k32.2M298](/packages/league-html-to-markdown)[cebe/markdown

A super fast, highly extensible markdown parser for PHP

1.0k34.1M148](/packages/cebe-markdown)[benjaminhoegh/parsedown-extended

An extension for Parsedown.

5126.7k1](/packages/benjaminhoegh-parsedown-extended)

PHPackages © 2026

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