PHPackages                             condenast-spain/parsedown - 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. condenast-spain/parsedown

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

condenast-spain/parsedown
=========================

Parser for Markdown.

1.7.4(7y ago)01.0k21MITPHPPHP &gt;=5.3.0

Since Jul 10Pushed 7y ago4 watchersCompare

[ Source](https://github.com/condenast-spain/parsedown)[ Packagist](https://packagist.org/packages/condenast-spain/parsedown)[ RSS](/packages/condenast-spain-parsedown/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (74)Used By (1)

Parsedown
---------

[](#parsedown)

Better Markdown Parser in PHP

[Demo](http://parsedown.org/demo) | [Benchmarks](http://parsedown.org/speed) | [Tests](http://parsedown.org/tests/) |

### Features

[](#features)

- One File
- No Dependencies
- Super Fast
- Extensible
- [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
- Tested in 5.3 to 7.2 and in HHVM
- [Markdown Extra extension](https://github.com/condenast-spain/parsedown-extra)

### Installation

[](#installation)

#### Composer

[](#composer)

Install the [composer package](https://packagist.org/packages/condenast-spain/parsedown "The Parsedown package on packagist.org") by running the following command:

```
composer require condenast-spain/parsedown

```

#### Manual

[](#manual)

1. Download the "Source code" from the [latest release](https://github.com/condenast-spain/parsedown/releases/latest "The latest release of Parsedown")
2. Include `Parsedown.php`

### Example

[](#example)

```
$Parsedown = new Parsedown();

echo $Parsedown->text('Hello _Parsedown_!'); # prints: Hello Parsedown!
// you can also parse inline markdown only
echo $Parsedown->line('Hello _Parsedown_!'); # prints: Hello Parsedown!
```

### Security

[](#security)

Parsedown is capable of escaping user-input within the HTML that it generates. Additionally Parsedown will apply sanitisation to additional scripting vectors (such as scripting link destinations) that are introduced by the markdown syntax itself.

To tell Parsedown that it is processing untrusted user-input, use the following:

```
$parsedown = new Parsedown;
$parsedown->setSafeMode(true);
```

If instead, you wish to allow HTML within untrusted user-input, but still want output to be free from XSS it is recommended that you make use of a HTML sanitiser that allows HTML tags to be whitelisted, like [HTML Purifier](http://htmlpurifier.org/).

In both cases you should strongly consider employing defence-in-depth measures, like [deploying a Content-Security-Policy](https://scotthelme.co.uk/content-security-policy-an-introduction/) (a browser security feature) so that your page is likely to be safe even if an attacker finds a vulnerability in one of the first lines of defence above.

#### Security of Parsedown Extensions

[](#security-of-parsedown-extensions)

Safe mode does not necessarily yield safe results when using extensions to Parsedown. Extensions should be evaluated on their own to determine their specific safety against XSS.

### Escaping HTML

[](#escaping-html)

> ⚠️ **WARNING:** This method isn't safe from XSS!

If you wish to escape HTML **in trusted input**, you can use the following:

```
$parsedown = new Parsedown;
$parsedown->setMarkupEscaped(true);
```

Beware that this still allows users to insert unsafe scripting vectors, such as links like `[xss](javascript:alert%281%29)`.

### Questions

[](#questions)

**How does Parsedown work?**

It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line starts with a `-` then perhaps it belongs to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).

We call this approach "line based". We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages.

**Is it compliant with CommonMark?**

It passes most of the CommonMark tests. Most of the tests that don't pass deal with cases that are quite uncommon. Still, as CommonMark matures, compliance should improve.

**Who uses it?**

[Laravel Framework](https://laravel.com/), [Bolt CMS](http://bolt.cm/), [Grav CMS](http://getgrav.org/), [Herbie CMS](http://www.getherbie.org/), [Kirby CMS](http://getkirby.com/), [October CMS](http://octobercms.com/), [Pico CMS](http://picocms.org), [Statamic CMS](http://www.statamic.com/), [phpDocumentor](http://www.phpdoc.org/), [RaspberryPi.org](http://www.raspberrypi.org/), [Symfony demo](https://github.com/symfony/symfony-demo) and more.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 58.3% 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 ~64 days

Total

73

Last Release

2731d ago

Major Versions

0.9.4 → 1.0.0-rc.12014-04-17

1.7.1 → 2.0.x-dev2018-04-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/96e63527b15f4dcdafae274f446e6792f246084f7d44814bece718175b0211af?d=identicon)[jmclemente](/maintainers/jmclemente)

![](https://www.gravatar.com/avatar/91ab6bbef5fc10f51c52bd95ffb55045b011cf55c185ba14fd870dc370c05d99?d=identicon)[jmcamacho](/maintainers/jmcamacho)

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

---

Top Contributors

[![erusev](https://avatars.githubusercontent.com/u/184170?v=4)](https://github.com/erusev "erusev (464 commits)")[![aidantwoods](https://avatars.githubusercontent.com/u/3288888?v=4)](https://github.com/aidantwoods "aidantwoods (215 commits)")[![PhrozenByte](https://avatars.githubusercontent.com/u/920356?v=4)](https://github.com/PhrozenByte "PhrozenByte (28 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (20 commits)")[![jmclemente](https://avatars.githubusercontent.com/u/9280325?v=4)](https://github.com/jmclemente "jmclemente (8 commits)")[![naNuke](https://avatars.githubusercontent.com/u/4591126?v=4)](https://github.com/naNuke "naNuke (7 commits)")[![rhukster](https://avatars.githubusercontent.com/u/1084697?v=4)](https://github.com/rhukster "rhukster (6 commits)")[![wkpark](https://avatars.githubusercontent.com/u/232347?v=4)](https://github.com/wkpark "wkpark (6 commits)")[![Yon-F](https://avatars.githubusercontent.com/u/4632018?v=4)](https://github.com/Yon-F "Yon-F (4 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (4 commits)")[![Daniel-KM](https://avatars.githubusercontent.com/u/2138485?v=4)](https://github.com/Daniel-KM "Daniel-KM (4 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (3 commits)")[![KaneCohen](https://avatars.githubusercontent.com/u/578455?v=4)](https://github.com/KaneCohen "KaneCohen (3 commits)")[![jmsv](https://avatars.githubusercontent.com/u/14852491?v=4)](https://github.com/jmsv "jmsv (3 commits)")[![grogy](https://avatars.githubusercontent.com/u/1322983?v=4)](https://github.com/grogy "grogy (2 commits)")[![HelpingHand1](https://avatars.githubusercontent.com/u/197991695?v=4)](https://github.com/HelpingHand1 "HelpingHand1 (2 commits)")[![luizbills](https://avatars.githubusercontent.com/u/1798830?v=4)](https://github.com/luizbills "luizbills (2 commits)")[![m1guelpf](https://avatars.githubusercontent.com/u/23558090?v=4)](https://github.com/m1guelpf "m1guelpf (2 commits)")[![NathanBaulch](https://avatars.githubusercontent.com/u/249604?v=4)](https://github.com/NathanBaulch "NathanBaulch (2 commits)")[![MechanicalMann](https://avatars.githubusercontent.com/u/2583176?v=4)](https://github.com/MechanicalMann "MechanicalMann (1 commits)")

---

Tags

parsermarkdown

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/condenast-spain-parsedown/health.svg)

```
[![Health](https://phpackages.com/badges/condenast-spain-parsedown/health.svg)](https://phpackages.com/packages/condenast-spain-parsedown)
```

###  Alternatives

[erusev/parsedown

Parser for Markdown.

15.0k151.8M732](/packages/erusev-parsedown)[league/commonmark

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

2.9k404.0M702](/packages/league-commonmark)[erusev/parsedown-extra

An extension of Parsedown that adds support for Markdown Extra.

84314.8M192](/packages/erusev-parsedown-extra)[parsedown/parsedown

Parser for Markdown.

21342.8k3](/packages/parsedown-parsedown)[tovic/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5933.7k](/packages/tovic-parsedown-extra-plugin)[taufik-nurrohman/parsedown-extra-plugin

Configurable Markdown to HTML converter with Parsedown Extra.

5932.3k](/packages/taufik-nurrohman-parsedown-extra-plugin)

PHPackages © 2026

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