PHPackages                             nazar-pc/php-markdown-next - 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. nazar-pc/php-markdown-next

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

nazar-pc/php-markdown-next
==========================

PHP Markdown Next

2.0.6(12y ago)104.2k1BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jan 12Pushed 12y ago3 watchersCompare

[ Source](https://github.com/nazar-pc/php-markdown-next)[ Packagist](https://packagist.org/packages/nazar-pc/php-markdown-next)[ Docs](https://github.com/nazar-pc/php-markdown-next)[ RSS](/packages/nazar-pc-php-markdown-next/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (16)Used By (0)

PHP Markdown Next
=================

[](#php-markdown-next)

PHP Markdown Next

by Nazar Mokrynskyi

based on PHP Markdown Extra by Michel Fortin

with changes from PHP Markdown Extra Extended by Egil Hansen

based on original Markdown by John Gruber

Introduction
------------

[](#introduction)

This is a library package that includes the PHP Markdown Next parser, which is based on PHP Markdown Extra and PHP Markdown Extra Extended parsers.

Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

"Markdown" is two things: a plain text markup syntax, and a software tool, written in Perl, that converts the plain text markup to HTML. PHP Markdown is a port to PHP of the original Markdown program by John Gruber.

Full documentation of Markdown's syntax is available on John's Markdown page: PHP Markdown Extra syntax is described by Michel Fortin: Changes in PHP Markdown Extra Extended are described in corresponding repository by Egil Hansen:

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

[](#requirements)

This library package requires PHP 5.4 or later.

Usage
-----

[](#usage)

In order to use this library, you can use composer:

```
{
    "require": {
        "nazar-pc/php-markdown-next": "*"
    }
}

```

Or include file `src/nazarpc/MarkdownNext.php` manually (see `example/index.php` file).

Then you can use class:

```
use nazarpc\MarkdownNext;
$my_html = MarkdownNext::defaultTransform($my_text);

```

Static method `defaultTransform` is used in example above, but if you want to customize default settings - you can create instance of `MarkdownNext` class:

```
use nazarpc\MarkdownNext;
$parser = new MarkdownNext;
$parser->fn_id_prefix = "post22-";
$my_html = $parser->transform($my_text);

```

To learn more, see the full list of [Markdown Extra configuration variables](http://michelf.ca/projects/php-markdown/extra/) and [Markdown configuration variables](http://michelf.ca/projects/php-markdown/configuration/).

Public API and Versioning Policy
--------------------------------

[](#public-api-and-versioning-policy)

Version numbers are of the form *major*.*minor*.*patch*.

The public API of PHP Markdown Next consist of the parser class `MarkdownNext`, its constructor, the `transform` and `defaultTransform` methods and their configuration variables. The public API is stable for a given major version number. It might get additions when the minor version number increments.

**Protected members are not considered public API.** This is unconventional and deserves an explanation. Incrementing the major version number every time the underlying implementation of something changes is going to give nonessential version numbers for the vast majority of people who just use the parser. Protected members are meant to create parser subclasses that behave in different ways. Very few people create parser subclasses. I don't want to discourage it by making everything private, but at the same time I can't guarantee any stable hook between versions if you use protected members.

**Syntax changes** will increment the minor number for new features, and the patch number for small corrections. A *new feature* is something that needs a change in the syntax documentation.

Bugs and Contributions
----------------------

[](#bugs-and-contributions)

Reporting of issues and creating of pull requests are highly appreciated!

Also feel free to contact me via email

Please include with your bug report: (1) the example of input; (2) the output you expected; (3) the output PHP Markdown Next actually produced.

Versions History
----------------

[](#versions-history)

PHP Markdown Next 2.0.0 (10 Nov 2013):

This is first release of Next series.

- Git version of PHP Markdown repository on 4 Nov 2013 was taken as the base
- Code reformatted, some properties renamed, added proper PHPDoc sections so that IDE now can work with them
- Several rejected pull requests of PHP Markdown Extra were added:
- GFM-Style Fenced Code Blocks by Jason Caldwell
- Enhanced ordered list by Matt Gorle
- Convert public member comments to PHPDoc format (partial work in this direction) by Mark Trapp
- Added changes from PHP Markdown Extra Extended, which was based on old version of PHP Markdown Extra
- Markdown and MarkdownExtra classes together with other changes merged into single class MarkdownNext
- Some internal changes, like moving of protected methods to closures in callbacks, short array syntax usage, short ternary operators

PHP Markdown Lib 1.3 (11 Apr 2013):

This is the first release of PHP Markdown Lib. This package requires PHP version 4.3 or later and is designed to work with PSR-0 autoloading and, optionally with Composer. Here is a list of the changes since PHP Markdown Extra 1.2.6:

- Plugin interface for WordPress and other systems is no longer present in the Lib package. The classic package is still available if you need it:
- Added `public` and `protected` protection attributes, plus a section about what is "public API" and what isn't in the Readme file.
- Changed HTML output for footnotes: now instead of adding `rel` and `rev`attributes, footnotes links have the class name `footnote-ref` and backlinks `footnote-backref`.
- Fixed some regular expressions to make PCRE not shout warnings about POSIX collation classes (dependent on your version of PCRE).
- Added optional class and id attributes to images and links using the same syntax as for headers:

    ```
    [link](url){#id .class}
    ![img](url){#id .class}

    ```

    It work too for reference-style links and images. In this case you need to put those attributes at the reference definition:

    ```
    [link][linkref] or [linkref]
    ![img][linkref]

    [linkref]: url "optional title" {#id .class}

    ```
- Fixed a PHP notice message triggered when some table column separator markers are missing on the separator line below column headers.
- Fixed a small mistake that could cause the parser to retain an invalid state related to parsing links across multiple runs. This was never observed (that I know of), but it's still worth fixing.

Copyright and License
---------------------

[](#copyright-and-license)

BSD 3-Clause License

See `license.md` file for details

###  Health Score

35

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 79.4% 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.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~6 days

Total

15

Last Release

4434d ago

Major Versions

1.3 → 2.0.02013-11-10

2.0.6 → 3.0.x-dev2014-01-29

PHP version history (2 changes)1.3-beta1PHP &gt;=5.3.0

2.0.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/050c23d89354489e351eed5096aa585badd35d2bbe283218bbb8f2516534c513?d=identicon)[nazar-pc](/maintainers/nazar-pc)

---

Top Contributors

[![michelf](https://avatars.githubusercontent.com/u/298045?v=4)](https://github.com/michelf "michelf (247 commits)")[![nazar-pc](https://avatars.githubusercontent.com/u/928965?v=4)](https://github.com/nazar-pc "nazar-pc (42 commits)")[![mmcclimon](https://avatars.githubusercontent.com/u/1698723?v=4)](https://github.com/mmcclimon "mmcclimon (7 commits)")[![coreyworrell](https://avatars.githubusercontent.com/u/162595?v=4)](https://github.com/coreyworrell "coreyworrell (6 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (2 commits)")[![simensen](https://avatars.githubusercontent.com/u/191200?v=4)](https://github.com/simensen "simensen (1 commits)")[![barraponto](https://avatars.githubusercontent.com/u/134005?v=4)](https://github.com/barraponto "barraponto (1 commits)")[![yosymfony](https://avatars.githubusercontent.com/u/3321099?v=4)](https://github.com/yosymfony "yosymfony (1 commits)")[![donatj](https://avatars.githubusercontent.com/u/133747?v=4)](https://github.com/donatj "donatj (1 commits)")[![itafroma](https://avatars.githubusercontent.com/u/277116?v=4)](https://github.com/itafroma "itafroma (1 commits)")[![mynetx](https://avatars.githubusercontent.com/u/6348321?v=4)](https://github.com/mynetx "mynetx (1 commits)")[![rdancer](https://avatars.githubusercontent.com/u/51028?v=4)](https://github.com/rdancer "rdancer (1 commits)")

---

Tags

markdown

### Embed Badge

![Health badge](/badges/nazar-pc-php-markdown-next/health.svg)

```
[![Health](https://phpackages.com/badges/nazar-pc-php-markdown-next/health.svg)](https://phpackages.com/packages/nazar-pc-php-markdown-next)
```

###  Alternatives

[erusev/parsedown

Parser for Markdown.

15.0k150.2M630](/packages/erusev-parsedown)[league/commonmark

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

2.9k393.7M556](/packages/league-commonmark)[michelf/php-markdown

PHP Markdown

3.5k51.8M299](/packages/michelf-php-markdown)[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k27.5M166](/packages/league-html-to-markdown)[cebe/markdown

A super fast, highly extensible markdown parser for PHP

1.0k32.0M121](/packages/cebe-markdown)[erusev/parsedown-extra

An extension of Parsedown that adds support for Markdown Extra.

84314.6M172](/packages/erusev-parsedown-extra)

PHPackages © 2026

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