PHPackages                             aymdev/commonmark-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. aymdev/commonmark-bundle

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

aymdev/commonmark-bundle
========================

Symfony bundle integrating League CommonMark for Symfony 4.4+ applications

v2.1.0(4y ago)72.4kMITPHPPHP ^7.4||^8.0

Since Oct 15Pushed 4y ago2 watchersCompare

[ Source](https://github.com/AymDev/CommonMarkBundle)[ Packagist](https://packagist.org/packages/aymdev/commonmark-bundle)[ RSS](/packages/aymdev-commonmark-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (8)Dependencies (16)Versions (10)Used By (0)

CommonMarkBundle
================

[](#commonmarkbundle)

A **Symfony 4 / 5 / 6** bundle to easily configure [league/commonmark](https://github.com/thephpleague/commonmark) **v2**, allowing you to set multiple **MarkDown** converters.

[![Unit Test Suite](https://github.com/AymDev/CommonMarkBundle/workflows/Unit%20Test%20Suite/badge.svg)](https://github.com/AymDev/CommonMarkBundle/workflows/Unit%20Test%20Suite/badge.svg)[![Coding Standards](https://github.com/AymDev/CommonMarkBundle/workflows/Coding%20Standards/badge.svg)](https://github.com/AymDev/CommonMarkBundle/workflows/Coding%20Standards/badge.svg)[![Bundle installation](https://github.com/AymDev/CommonMarkBundle/workflows/Bundle%20installation/badge.svg)](https://github.com/AymDev/CommonMarkBundle/workflows/Bundle%20installation/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/ca08298d90ef179091eba7385ff6a6948630d474fadaf62d151946774c053b06/68747470733a2f2f706f7365722e707567782e6f72672f61796d6465762f636f6d6d6f6e6d61726b2d62756e646c652f76)](//packagist.org/packages/aymdev/commonmark-bundle)[![License](https://camo.githubusercontent.com/b7f62f3e5c6e1f48f0d637d40c4967f3010d2abe99404af904e9e34d01753ab8/68747470733a2f2f706f7365722e707567782e6f72672f61796d6465762f636f6d6d6f6e6d61726b2d62756e646c652f6c6963656e7365)](//packagist.org/packages/aymdev/commonmark-bundle)

- [Installation](#installation)
- [Configuration](#configuration)
    - [Converter type](#converter-type)
    - [Converter options](#converter-options)
    - [Converter extensions](#converter-extensions)
- [Using the converters](#using-the-converters)
    - [As services](#as-services)
    - [In your templates](#in-your-templates)

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

[](#installation)

Simply install it with **Composer**, an auto-generated recipe will enable the bundle for you:

```
composer require aymdev/commonmark-bundle
```

Configuration
-------------

[](#configuration)

No converter is created by default. Create a **YAML** configuration file at path `config/packages/aymdev_commonmark.yaml`. Here is an example configuration declaring 2 converters:

```
aymdev_commonmark:
    converters:
        # add any converter here
        my_converter:
            type: 'github'
            options:
                enable_strong: true
                use_underscore: false

        blog_post_converter:
            type: 'commonmark'
            extensions:
                - League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkExtension
```

> Note that all keys inside a converter are optional.

### Converter type

[](#converter-type)

The `type` key can be used to choose between a *CommonMark* or a *GitHub* converter:

- `commonmark` (default): `MarkdownConverter` with `CommonMarkCoreExtension`
- `github`: `MarkdownConverter` with `GithubFlavoredMarkdownExtension`
- `empty`: an empty `MarkdownConverter` (e.g. to use `InlinesOnlyExtension`)

### Converter options

[](#converter-options)

The `options` key holds the configuration passed to the converter, as an array.

> For more information, see the [CommonMark documentation about Configuration](https://commonmark.thephpleague.com/2.0/configuration/).

### Converter extensions

[](#converter-extensions)

The `extensions` key allows to add any extension class to a converter.

> Check the complete list of extensions on the [CommonMark documentation](https://commonmark.thephpleague.com/2.0/extensions/overview/).

Using the converters
--------------------

[](#using-the-converters)

### As services

[](#as-services)

The bundle registers your converters as **services** with the converter name as the **service ID**.

It also creates an alias, so you can get them by *autowiring* using the *converter name* as the *argument name*, type with the `League\CommonMark\MarkdownConverter` class.

**Example YAML configuration**:

```
aymdev_commonmark:
    converters:
        # You can add an argument for this converter as:
        #   MarkdownConverter $myConverter
        my_converter:
```

### In your templates

[](#in-your-templates)

You can use the `commonmark` **Twig** filter. You only need to pass it a *converter name*:

```
{{ markdown_content|commonmark('my_converter') }}
```

> If you have only 1 *converter* you can ommit the *converter name*.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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

Recently: every ~101 days

Total

8

Last Release

1626d ago

Major Versions

v1.3.1 → v2.0.02021-11-14

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v2.0.0PHP ^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/58fe05cbfb0d7e61f369dabfdd2bac390e8e93bfbd4634a9cc6c1e7786efaaf3?d=identicon)[aymdev](/maintainers/aymdev)

---

Top Contributors

[![AymDev](https://avatars.githubusercontent.com/u/22072016?v=4)](https://github.com/AymDev "AymDev (36 commits)")

---

Tags

commonmarkmarkdownphpsymfonysymfony-bundlesymfony4symfony5

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aymdev-commonmark-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/aymdev-commonmark-bundle/health.svg)](https://phpackages.com/packages/aymdev-commonmark-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[scheb/2fa

Two-factor authentication for Symfony applications (please use scheb/2fa-bundle to install)

578630.7k1](/packages/scheb-2fa)[chameleon-system/chameleon-base

The Chameleon System core.

1026.5k3](/packages/chameleon-system-chameleon-base)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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