PHPackages                             smith981/knp-markdown-bundle - 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. smith981/knp-markdown-bundle

ActiveSymfony-bundle[Parsing &amp; Serialization](/categories/parsing)

smith981/knp-markdown-bundle
============================

Knplabs markdown bundle transforms markdown into html

1.3.2(12y ago)0109MITPHPPHP &gt;=5.3.9

Since Oct 15Pushed 11y ago1 watchersCompare

[ Source](https://github.com/smith981/KnpMarkdownBundle)[ Packagist](https://packagist.org/packages/smith981/knp-markdown-bundle)[ Docs](http://github.com/KnpLabs/KnpMarkdownBundle)[ RSS](/packages/smith981-knp-markdown-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (7)Used By (0)

Provide markdown conversion (based on Michel Fortin work) to your Symfony2 projects.

[![Build Status](https://camo.githubusercontent.com/445545dbfc979917fd005ce17b5d120e6fa3ca7bba8f6a79974ffe2930b6dc66/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f4b6e704c6162732f4b6e704d61726b646f776e42756e646c652e706e67)](http://travis-ci.org/KnpLabs/KnpMarkdownBundle)

INSTALLATION
------------

[](#installation)

Add KnpMarkdownBundle to your `composer.json`

```
{
    "require": {
        "knplabs/knp-markdown-bundle": "~1.3"
    }
}
```

Register the bundle in `app/AppKernel.php`

```
$bundles = array(
    // ...
    new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
);
```

USAGE
-----

[](#usage)

```
// Use the service
$html = $this->container->get('markdown.parser')->transformMarkdown($text);

// Use the helper with default parser
echo $view['markdown']->transform($text);

// Use the helper and a select specific parser
echo $view['markdown']->transform($text, $parserName);
```

If you have enabled the Twig markdown filter, you can use the following in your Twig templates:

```
{# Use default parser #}
{{ my_data|markdown }}

{# Or select specific parser #}
{{ my_data|markdown('parserName') }}
```

Change the parser implementation
--------------------------------

[](#change-the-parser-implementation)

Create a service implementing `Knp\Bundle\MarkdownBundle\MarkdownParserInterface`, then configure the bundle to use it:

```
knp_markdown:
    parser:
        service: my.markdown.parser
```

Alternatively if you are using the `markdown.parser.sundown` there are options for enabling sundown extensions and render flags, see the default Configuration with:

```
php app/console config:dump-reference knp_markdown

```

This bundle comes with 5 parser services, 4 based on the same algorithm but providing different levels of compliance to the markdown specification, and one which is uses the php sundown extension:

```
- markdown.parser.max       // fully compliant = slower (default implementation)
- markdown.parser.medium    // expensive and uncommon features dropped
- markdown.parser.light     // expensive features dropped
- markdown.parser.min       // most features dropped = faster
- markdown.parser.sundown   // faster and fully compliant (recommended)

```

`markdown.parser.sundown` requires the [php sundown extension](https://github.com/chobie/php-sundown).

For more details, see the implementations in Parser/Preset.

TEST
----

[](#test)

```
phpunit -c myapp vendor/bundles/Knp/Bundle/MarkdownBundle

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor4

4 contributors hold 50%+ of commits

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 ~98 days

Recently: every ~122 days

Total

6

Last Release

4463d ago

PHP version history (2 changes)1.1.0PHP &gt;=5.3.3

1.3.1PHP &gt;=5.3.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/101362d108163ebbcb923469d5e479eb3cbce9c710115992c0c1217677ecfba6?d=identicon)[smith981](/maintainers/smith981)

---

Top Contributors

[![ornicar](https://avatars.githubusercontent.com/u/140370?v=4)](https://github.com/ornicar "ornicar (39 commits)")[![pilot](https://avatars.githubusercontent.com/u/28564?v=4)](https://github.com/pilot "pilot (15 commits)")[![stloyd](https://avatars.githubusercontent.com/u/67402?v=4)](https://github.com/stloyd "stloyd (12 commits)")[![mbontemps](https://avatars.githubusercontent.com/u/231249?v=4)](https://github.com/mbontemps "mbontemps (11 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (7 commits)")[![Herzult](https://avatars.githubusercontent.com/u/177588?v=4)](https://github.com/Herzult "Herzult (6 commits)")[![smith981](https://avatars.githubusercontent.com/u/342097?v=4)](https://github.com/smith981 "smith981 (5 commits)")[![pdenis](https://avatars.githubusercontent.com/u/1713289?v=4)](https://github.com/pdenis "pdenis (4 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (4 commits)")[![BAKFR](https://avatars.githubusercontent.com/u/1631475?v=4)](https://github.com/BAKFR "BAKFR (3 commits)")[![peterrehm](https://avatars.githubusercontent.com/u/2010989?v=4)](https://github.com/peterrehm "peterrehm (3 commits)")[![benji07](https://avatars.githubusercontent.com/u/166890?v=4)](https://github.com/benji07 "benji07 (3 commits)")[![BattleRattle](https://avatars.githubusercontent.com/u/1455740?v=4)](https://github.com/BattleRattle "BattleRattle (3 commits)")[![elnur](https://avatars.githubusercontent.com/u/821060?v=4)](https://github.com/elnur "elnur (3 commits)")[![tamirvs](https://avatars.githubusercontent.com/u/1403080?v=4)](https://github.com/tamirvs "tamirvs (2 commits)")[![julesbou](https://avatars.githubusercontent.com/u/328303?v=4)](https://github.com/julesbou "julesbou (2 commits)")[![l3pp4rd](https://avatars.githubusercontent.com/u/132389?v=4)](https://github.com/l3pp4rd "l3pp4rd (2 commits)")[![GromNaN](https://avatars.githubusercontent.com/u/400034?v=4)](https://github.com/GromNaN "GromNaN (2 commits)")[![xaav](https://avatars.githubusercontent.com/u/732630?v=4)](https://github.com/xaav "xaav (1 commits)")[![brikou](https://avatars.githubusercontent.com/u/383212?v=4)](https://github.com/brikou "brikou (1 commits)")

---

Tags

bundleknpknplabsmarkdown

### Embed Badge

![Health badge](/badges/smith981-knp-markdown-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/smith981-knp-markdown-bundle/health.svg)](https://phpackages.com/packages/smith981-knp-markdown-bundle)
```

###  Alternatives

[knplabs/knp-snappy-bundle

Easily create PDF and images in Symfony by converting Twig/HTML templates.

1.2k31.8M49](/packages/knplabs-knp-snappy-bundle)[knplabs/knp-paginator-bundle

Paginator bundle for Symfony to automate pagination and simplify sorting and other features

1.8k42.8M315](/packages/knplabs-knp-paginator-bundle)[presta/sitemap-bundle

A Symfony bundle that provides tools to build your application sitemap.

3929.4M28](/packages/presta-sitemap-bundle)

PHPackages © 2026

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