PHPackages                             xp-forge/markdown - 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. xp-forge/markdown

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

xp-forge/markdown
=================

Markdown

v8.1.2(8mo ago)017.7k—3%BSD-3-ClausePHPPHP &gt;=7.0.0CI passing

Since Jan 10Pushed 8mo ago2 watchersCompare

[ Source](https://github.com/xp-forge/markdown)[ Packagist](https://packagist.org/packages/xp-forge/markdown)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-forge-markdown/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (38)Used By (0)

Markdown for XP Framework
=========================

[](#markdown-for-xp-framework)

[![Build status on GitHub](https://github.com/xp-forge/markdown/workflows/Tests/badge.svg)](https://github.com/xp-forge/markdown/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/b001d5305b7df05452ff9a8edaa3206d782c950fcc06a044ee729a67a9ea0be5/68747470733a2f2f706f7365722e707567782e6f72672f78702d666f7267652f6d61726b646f776e2f76657273696f6e2e737667)](https://packagist.org/packages/xp-forge/markdown)

The [Markdown syntax](http://daringfireball.net/projects/markdown/syntax) implemented for the XP Framework.

Example
-------

[](#example)

To transform markdown to HTML, all that is necessary is the following:

```
use net\daringfireball\markdown\Markdown;

$engine= new Markdown();
$transformed= $engine->transform(
  'This is [Markdown](http://daringfireball.net/projects/markdown/) for **XP**'
);
```

The implementation is based on a parse tree. To work with the tree, you can use the `parse()` method, which returns a `net.daringfireball.markdown.ParseTree` instance.

```
use net\daringfireball\markdown\{Markdown, ToHtml};
use io\streams\TextReader;
use io\File;

$engine= new Markdown();

$tree= $engine->parse($markdown);
$tree= $engine->parse(new TextReader(new File('file.md')));

// ...work with tree...

$transformed= $tree->emit(new ToHtml());
```

You can control the URLs used in the `href` and `src` attributes of links and images, respectively, by using URL rewriting API:

```
use net\daringfireball\markdown\{ToHtml, URLs, Rewriting};

$emitter= new ToHtml(new URLs(Rewriting::absolute()
  ->links('/deref?url=%s')
  ->images('/proxy?url=&s')
  ->excluding(['localhost'])
));

$transformed= $engine->transform($markdown, [], $emitter);
$transformed= $engine->parse($markdown)->emit($emitter);
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance60

Regular maintenance activity

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~108 days

Recently: every ~177 days

Total

37

Last Release

255d ago

Major Versions

v3.2.4 → v4.0.02017-06-04

v4.1.1 → v5.0.02018-07-22

v5.2.2 → v6.0.02020-04-10

v6.1.0 → v7.0.02023-03-23

v7.1.2 → v8.0.02023-09-27

PHP version history (4 changes)v1.0.0PHP &gt;=5.4.0

v2.0.0PHP &gt;=5.5.0

v4.0.0PHP &gt;=5.6.0

v6.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (328 commits)")

---

Tags

markdownparserphptreexp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-forge-markdown/health.svg)

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

PHPackages © 2026

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