PHPackages                             giberti/commonmark-emoji-extension - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. giberti/commonmark-emoji-extension

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

giberti/commonmark-emoji-extension
==================================

Adds emoji support for CommonMark

1.4.1(3mo ago)33.8k1MITPHPPHP ^7.4|^8.0CI passing

Since Sep 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/giberti/commonmark-emoji-extension)[ Packagist](https://packagist.org/packages/giberti/commonmark-emoji-extension)[ RSS](/packages/giberti-commonmark-emoji-extension/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (13)Used By (0)

CommonMark Emoji Extension
==========================

[](#commonmark-emoji-extension)

An extension to provide GitHub and Slack style emoji for the [League CommonMark package](https://commonmark.thephpleague.com/). By default, it will substitute official [unicode CLDR short names](http://unicode.org/emoji/charts/full-emoji-list.html) for the emoji, but can also use aliases to map common language to the official name. The generated output wraps the emoji in a `` to permit additional styling and provides a `title` attribute for accessibility.

Quality
-------

[](#quality)

[![Build and Test](https://github.com/giberti/commonmark-emoji-extension/actions/workflows/test-php.yml/badge.svg)](https://github.com/giberti/commonmark-emoji-extension/actions/workflows/test-php.yml)

### Installing

[](#installing)

```
composer require giberti/commonmark-emoji-extension

```

Usage
-----

[](#usage)

```
use Giberti\EmojiExtension\EmojiExtension;
```

### Basic

[](#basic)

To use, add a new instance of `EmojiExtension` to the CommonMark environment and use as you would normally.

```
// Get a configured instance of the converter
$environment = new \League\CommonMark\Environment\Environment();
$environment->addExtension(new \League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension());
$environment->addExtension(new \Giberti\EmojiExtension\EmojiExtension());
$converter = new \League\CommonMark\MarkdownConverter($environment);

// I can haz ☕?
echo $converter->convert('I can haz :hot_beverage:?')->getContent();
```

### Providing Aliases

[](#providing-aliases)

GitHub and Slack both shortcuts that do not map directly to the official Unicode CLDR Short Name. Mappings can be injected at the time the instance of `EmojiExtension` is created.

The Aliases should be passed as an associative array with the key being the new alias and the value being the CLDR Short Name equivalent.

```
$aliases = [
    ':coffee:' => ':hot_beverage:',
    ':smile:' => ':grinning_face_with_smiling_eyes:',
    // ... any other aliases you wish to support
];

// Get a configured instance of the converter
$environment = new \League\CommonMark\Environment\Environment();
$environment->addExtension(new \League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension());
$environment->addExtension(new \Giberti\EmojiExtension\EmojiExtension($aliases));
$converter = new \League\CommonMark\MarkdownConverter($environment);

// I can haz ☕?
echo $converter->convert('I can haz :coffee:?')->getContent();
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.9% 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 ~195 days

Recently: every ~301 days

Total

11

Last Release

108d ago

Major Versions

0.5 → 1.02022-02-26

PHP version history (4 changes)0.1PHP ^7.2

v0.3PHP ^7.3|8.0

v0.4PHP ^7.3|^8.0

1.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/771060?v=4)[Erik Giberti](/maintainers/giberti)[@giberti](https://github.com/giberti)

---

Top Contributors

[![giberti](https://avatars.githubusercontent.com/u/771060?v=4)](https://github.com/giberti "giberti (37 commits)")[![vladsf](https://avatars.githubusercontent.com/u/4058524?v=4)](https://github.com/vladsf "vladsf (2 commits)")

---

Tags

commonmarkemojiphp7php8

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/giberti-commonmark-emoji-extension/health.svg)

```
[![Health](https://phpackages.com/badges/giberti-commonmark-emoji-extension/health.svg)](https://phpackages.com/packages/giberti-commonmark-emoji-extension)
```

PHPackages © 2026

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