PHPackages                             yivoff/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. [Framework](/categories/framework)
4. /
5. yivoff/commonmark-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

yivoff/commonmark-bundle
========================

Symfony bundle integrating League CommonMark for Symfony 6.2+ applications

1.2.0(2y ago)22.4kMITPHPPHP ^8.2

Since Aug 24Pushed 2y ago2 watchersCompare

[ Source](https://github.com/yivi/CommonMarkBundle)[ Packagist](https://packagist.org/packages/yivoff/commonmark-bundle)[ RSS](/packages/yivoff-commonmark-bundle/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (13)Versions (6)Used By (0)

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

[](#commonmarkbundle)

A **Symfony 5+** bundle to integrate [league/commonmark](https://github.com/thephpleague/commonmark) v2, allowing you to set multiple Commonmark converters.

[![PHP Version Require](https://camo.githubusercontent.com/8f79158b0ecb348f7957058f4a8646002da082cf305731c65216a16cbfaa3856/687474703a2f2f706f7365722e707567782e6f72672f7969766f66662f636f6d6d6f6e6d61726b2d62756e646c652f726571756972652f706870)](https://packagist.org/packages/yivoff/commonmark-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/3769daf387ea075b7a32855ebbfdae6f372e2c6157c20c2cc8d9804359ef82b2/687474703a2f2f706f7365722e707567782e6f72672f7969766f66662f636f6d6d6f6e6d61726b2d62756e646c652f76)](https://packagist.org/packages/yivoff/commonmark-bundle)[![Total Downloads](https://camo.githubusercontent.com/cff552f448238b535874477270558db54473f2a2573133202b52fee7b5658b05/687474703a2f2f706f7365722e707567782e6f72672f7969766f66662f636f6d6d6f6e6d61726b2d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/yivoff/commonmark-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/a4e92249b2dfd717bc20e21853639c2e9a118dd69670a6770f5b2314e66d8fff/687474703a2f2f706f7365722e707567782e6f72672f7969766f66662f636f6d6d6f6e6d61726b2d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/yivoff/commonmark-bundle)[![License](https://camo.githubusercontent.com/1eae849c813279578724a863fcc09f8ec7c58a24669afb3ac42c7bc200b4b09e/687474703a2f2f706f7365722e707567782e6f72672f7969766f66662f636f6d6d6f6e6d61726b2d62756e646c652f6c6963656e7365)](https://packagist.org/packages/yivoff/commonmark-bundle)[![Tests](https://github.com/yivi/CommonMarkBundle/actions/workflows/bundle_tests.yaml/badge.svg)](https://github.com/yivi/CommonMarkBundle/actions/workflows/bundle_tests.yaml/badge.svg)

- [Requirements](#requirements)
- [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)
    - [Usage in templates](#usage-in-templates)

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

[](#requirements)

This bundle requires PHP 8+ and Symfony 5+.

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

[](#installation)

```
composer require yivoff/commonmark-bundle
```

If for some reason you are running without Symfony Flex, enable the bundle as usual adding `Yivoff\CommonmarkBundle\YivoffCommonmarkBundle` to the bundle's array.

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

[](#configuration)

You'll need to enable at least one converter to use the bundle. Create a **YAML** configuration file at path `config/packages/aymdev_commonmark.yaml`. Here is an example configuration declaring 2 converters:

```
yivoff_commonmark:
   converters:
      commonmark:
         options:
            commonmark:
               enable_em: false

      github:
         type: github

      my_custom:
         type: custom
            extensions:
               - League\CommonMark\Extension\Autolink\AutolinkExtension
               - League\CommonMark\Extension\InlinesOnly\InlinesOnlyExtension
```

Setting up at least one converter is mandatory, but all settings are optional. By default, a converter without setting a `type` will be created as a CommonMark converter.

### Converter type

[](#converter-type)

The `type` key can be used to choose between a *CommonMark*, a *GitHub Flavoured* or a *Custom* converter.

By default, if not `type` is chosen, CommonMark will be chosen.

### Converter options

[](#converter-options)

You can use the `options` key holds the configuration passed to the converter, as an array.

Check the [CommonMark documentation](https://commonmark.thephpleague.com/2.0/configuration/) to learn more about the available options.

### Converter extensions

[](#converter-extensions)

The CommonMark and Github Flavoured have a predefined set of extensions installed, which cannot be changed.

But `custom` starts with no extensions, and you pick and choose [which extensions](https://commonmark.thephpleague.com/2.0/customization/extensions/) you want to enable using the `extensions` key.

This `key` has no effect on `github` or `commonmark` type converters.

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

[](#using-the-converters)

### As services

[](#as-services)

Each of the defined converters is available as a service within the container.

The id is generated with the following format: `yivoff_commonmark.converters.converter_name`.

For the converters in the configuration example three services would be generated:

- `yivoff_commonmark.converters.commonmark`
- `yivoff_commonmark.converters.github`
- `yivoff_commonmark.converters.my_custom`

Additionally, the bundle registers an alias for each service, so one can use the service directly for autowiring.

Again, for the above example the registered aliases would be:

- `League\CommonMark\ConverterInterface $commonmark`
- `League\CommonMark\ConverterInterface $github`
- `League\CommonMark\ConverterInterface $myCustom`

### Usage in templates

[](#usage-in-templates)

The bundle defines a Twig filter: `commonmark`.

If you have defined multiple converters, you need to pass the name of the converter you want to use:

```
{{ some_markdown_content|commonmark('github') }}
```

But If you have only one converter defined, the parameter can be omitted.

```
{{ some_markdown_content|commonmark }}
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

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

Total

5

Last Release

918d ago

PHP version history (3 changes)1.0.0PHP &gt;=8.0

v1.0.1PHP ^8.0

1.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0d85d0f1920fcb556200094ef25fe6d1c6c1540dac4b9118a0045d59b2a92bd?d=identicon)[yivi](/maintainers/yivi)

---

Top Contributors

[![yivi](https://avatars.githubusercontent.com/u/1815039?v=4)](https://github.com/yivi "yivi (23 commits)")

---

Tags

phpsymfonysymfony-5symfony-bundle

### Embed Badge

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

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

PHPackages © 2026

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