PHPackages                             clementtalleu/easyadmin-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. [Admin Panels](/categories/admin)
4. /
5. clementtalleu/easyadmin-markdown-bundle

ActiveSymfony-bundle[Admin Panels](/categories/admin)

clementtalleu/easyadmin-markdown-bundle
=======================================

A Markdown editor field for EasyAdmin, powered by EasyMDE.

00PHPCI passing

Since Jun 9Pushed todayCompare

[ Source](https://github.com/clementtalleu/EasyAdminMarkdownBundle)[ Packagist](https://packagist.org/packages/clementtalleu/easyadmin-markdown-bundle)[ RSS](/packages/clementtalleu-easyadmin-markdown-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

EasyAdminMarkdownBundle
=======================

[](#easyadminmarkdownbundle)

A Markdown editor field for [EasyAdmin](https://github.com/EasyCorp/EasyAdminBundle), powered by the [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) JavaScript editor.

It provides a `MarkdownEditorField` that behaves like EasyAdmin's built-in `TextEditorField` (which uses Trix), but lets your users write **Markdown** with a live preview, a toolbar and keyboard shortcuts. On the *detail* page the stored Markdown is rendered as sanitized HTML.

[![The MarkdownEditorField in an EasyAdmin form](docs/images/editor.png)](docs/images/editor.png)

**PHP**&gt;= 8.2**Symfony**7.x and 8.x**EasyAdmin**4.x and 5.x**Asset pipeline**[AssetMapper](https://symfony.com/doc/current/frontend/asset_mapper.html) (no build step required)Installation
------------

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.

### Step 1: Install the bundle

[](#step-1-install-the-bundle)

```
composer require clementtalleu/easyadmin-markdown-bundle
```

If your application uses [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), the bundle is enabled automatically. Otherwise, enable it by hand in `config/bundles.php`:

```
// config/bundles.php

return [
    // ...
    ClementTalleu\EasyAdminMarkdownBundle\ClementTalleuEasyAdminMarkdownBundle::class => ['all' => true],
];
```

### Step 2: Install the EasyMDE assets

[](#step-2-install-the-easymde-assets)

The bundle never ships third-party JavaScript itself, so you add EasyMDE to your application's [importmap](https://symfony.com/doc/current/frontend/asset_mapper.html#importmap-php). Use the self-contained build (it bundles CodeMirror and marked), which works reliably with AssetMapper:

```
php bin/console importmap:require easymde/dist/easymde.min.js
php bin/console importmap:require easymde/dist/easymde.min.css
```

That's it — the field automatically loads its own JavaScript (as an ES module) and stylesheet from the bundle, and the editor resolves EasyMDE from your importmap. No `importmap.php` editing is required.

### Step 3 (optional): Enable HTML rendering on the detail page

[](#step-3-optional-enable-html-rendering-on-the-detail-page)

To render the Markdown as HTML on the *detail* page, install a Markdown parser:

```
composer require league/commonmark
```

If you skip this step, the *detail* page falls back to displaying the raw Markdown source as plain text.

Usage
-----

[](#usage)

Use the field in any EasyAdmin CRUD controller, exactly like the native fields:

```
use ClementTalleu\EasyAdminMarkdownBundle\Field\MarkdownEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;

class ArticleCrudController extends AbstractCrudController
{
    public function configureFields(string $pageName): iterable
    {
        yield MarkdownEditorField::new('content');
    }
}
```

### Options

[](#options)

#### `setNumOfRows()`

[](#setnumofrows)

Sets the initial height (in rows) of the editor when its content is empty:

```
MarkdownEditorField::new('content')->setNumOfRows(20);
```

#### `setEasyMdeConfig()`

[](#seteasymdeconfig)

Passes any [EasyMDE configuration option](https://github.com/Ionaru/easy-markdown-editor#configuration) to the editor. The array is JSON-encoded and forwarded to the EasyMDE constructor on the client side:

```
MarkdownEditorField::new('content')->setEasyMdeConfig([
    'hideIcons' => ['guide', 'fullscreen'],
    'tabSize' => 4,
    'placeholder' => 'Write your story…',
]);
```

By default the bundle disables EasyMDE's built-in spell checker and status bar, and does not download Font Awesome (EasyAdmin already provides icons). You can re-enable any of these through `setEasyMdeConfig()`.

#### `renderAsHtml()`

[](#renderashtml)

Forces (or disables) HTML rendering on the *detail* page, regardless of whether `league/commonmark` is installed:

```
MarkdownEditorField::new('content')->renderAsHtml(false); // always show raw Markdown
```

How it works
------------

[](#how-it-works)

- The field renders a standard `` whose configuration is exposed through `data-*` attributes.
- A small, framework-agnostic JavaScript module (loaded through AssetMapper) scans the page and initializes EasyMDE on each editor — the same self-contained approach EasyAdmin uses for its own Trix editor, so it does **not** require a Stimulus application to be running on the admin pages.
- The editor keeps the original `` in sync so the form submits the Markdown source and EasyAdmin's "unsaved changes" detection keeps working.
- Required fields are validated client-side even though EasyMDE hides the original textarea.
- Markdown rendered on the *detail* page is sanitized (raw HTML is escaped and unsafe links are stripped) to prevent stored XSS.

Security
--------

[](#security)

The Markdown rendered on the *detail* page is converted with `league/commonmark` configured with `html_input: escape` and `allow_unsafe_links: false`. Any HTML embedded in the Markdown source is escaped rather than executed.

Running the tests
-----------------

[](#running-the-tests)

```
composer install
vendor/bin/phpunit
vendor/bin/phpstan analyse
vendor/bin/php-cs-fixer fix --dry-run --diff
```

License
-------

[](#license)

This bundle is released under the [MIT license](LICENSE).

###  Health Score

20

↑

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11056924?v=4)[Clément Talleu](/maintainers/clementtalleu)[@clementtalleu](https://github.com/clementtalleu)

---

Top Contributors

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

---

Tags

easyadmineasymdemarkdownphpsymfonysymfony-bundletwig

### Embed Badge

![Health badge](/badges/clementtalleu-easyadmin-markdown-bundle/health.svg)

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

###  Alternatives

[leung/laravel-adminer

adminer for laravel5.\*

169.0k](/packages/leung-laravel-adminer)

PHPackages © 2026

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